Skip to content

Fix WSL log tail commands#10501

Open
kswift1 wants to merge 2 commits intowarpdotdev:masterfrom
kswift1:fix/mcp-show-logs-wsl-path
Open

Fix WSL log tail commands#10501
kswift1 wants to merge 2 commits intowarpdotdev:masterfrom
kswift1:fix/mcp-show-logs-wsl-path

Conversation

@kswift1
Copy link
Copy Markdown

@kswift1 kswift1 commented May 8, 2026

Summary

  • convert Windows host log paths to session-native paths before building tail commands
  • apply the same session-aware tail command flow to MCP logs and LSP logs
  • add coverage for WSL path conversion and PowerShell behavior

Closes #10169.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 8, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @kswift1 on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@kswift1

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 8, 2026
@kswift1
Copy link
Copy Markdown
Author

kswift1 commented May 8, 2026

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label May 8, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 8, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates log-tail command construction so Windows host log paths can be converted for WSL/MSYS2-like sessions, and adds tests for WSL and PowerShell command output.

Concerns

  • The new call sites use terminal.sessions(ctx), but that accessor is only compiled for tests/integration builds, so normal app builds will fail. The same call also produces Option<Arc<Session>>, while tail_command_for_shell now expects Option<&Session>.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

let tail_command = tail_command_for_shell(shell_family, log_file_path);
let session = terminal
.active_block_session_id()
.and_then(|session_id| terminal.sessions(ctx).get(session_id));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] terminal.sessions(ctx) is gated behind #[cfg(any(test, feature = "integration_tests"))], and Sessions::get returns Arc<Session> rather than &Session, so this production call path will not compile; use sessions_model().as_ref(ctx).get(session_id).as_deref() or change the helper signature.

Comment thread app/src/workspace/view.rs Outdated
let tail_command = tail_command_for_shell(shell_family, log_path);
let session = terminal
.active_block_session_id()
.and_then(|session_id| terminal.sessions(ctx).get(session_id));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] terminal.sessions(ctx) is not available outside test/integration builds, and the returned Arc<Session> does not match the new Option<&Session> parameter; use the production sessions model accessor and convert with as_deref().

@kswift1 kswift1 force-pushed the fix/mcp-show-logs-wsl-path branch from 4f1b2f7 to 5d0c56c Compare May 8, 2026 18:19
@kswift1
Copy link
Copy Markdown
Author

kswift1 commented May 8, 2026

Addressed the review in a production-safe follow-up. The tail-command helper now takes shell identity via Option<&ShellLaunchData>, and the UI call sites use terminal.active_session_shell(ctx) instead of terminal.sessions(ctx). I also added MSYS2 coverage alongside the WSL test.\n\nI was able to run cargo fmt --all. Focused Rust tests are still blocked on the repo's long workspace build / JS build prerequisites in this environment, but the branch is updated and pushed at 5d0c56c.

@kswift1
Copy link
Copy Markdown
Author

kswift1 commented May 8, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@kswift1

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR introduces session-aware path conversion for tail commands used by MCP and LSP log viewing and adds unit coverage for WSL/MSYS2/PowerShell command output.

Concerns

  • MCP and LSP log opening add a fresh terminal pane before querying active_session_shell; for a newly-created pane the active session may not be bootstrapped yet, so WSL/MSYS2 launch data can be unavailable and the Windows log path remains unconverted.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

terminal_view_handle.update(ctx, |terminal, ctx| {
let shell_family = terminal.shell_family(ctx);
let tail_command = tail_command_for_shell(shell_family, log_file_path);
let shell_launch_data = terminal.active_session_shell(ctx);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] active_session_shell can be None immediately after creating the log pane, so WSL/MSYS2 sessions can still get the unconverted Windows log path; use the shell launch data chosen for the new pane instead of only the bootstrapped active session.

Comment thread app/src/workspace/view.rs Outdated
terminal_view_handle.update(ctx, |terminal, ctx| {
let shell_family = terminal.shell_family(ctx);
let tail_command = tail_command_for_shell(shell_family, log_path);
let shell_launch_data = terminal.active_session_shell(ctx);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] active_session_shell can be None immediately after creating the LSP log pane, so WSL/MSYS2 sessions can still get the unconverted Windows log path; use the shell launch data chosen for the new pane instead of only the bootstrapped active session.

@kswift1
Copy link
Copy Markdown
Author

kswift1 commented May 8, 2026

Addressed the fresh-pane timing issue. MCP/LSP log opening now uses a small TerminalView helper that prefers the active session shell after bootstrap and falls back to the terminal model's pre-bootstrap active shell launch data when the new pane has not joined a session yet.

This keeps the session-aware WSL/MSYS2 conversion, but avoids depending on freshly-bootstrapped pane session metadata.

@kswift1
Copy link
Copy Markdown
Author

kswift1 commented May 8, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@kswift1

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates log-tail command generation so MCP/LSP log paths are converted for WSL/MSYS2 sessions before being inserted into the active terminal.

Concerns

  • Manual testing evidence is missing for this manually testable behavioral change. Please include screenshots or a screen recording showing the log-tail flow working end to end in a WSL session, or justify why manual testing is not possible.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@kswift1
Copy link
Copy Markdown
Author

kswift1 commented May 8, 2026

This fix targets a Windows host + WSL shell path conversion issue. I wasn’t able to run an end-to-end manual verification in a Windows + WSL Warp environment from my current setup. I did validate the code path, updated the implementation to use pre-bootstrap shell launch data, and added targeted unit coverage for WSL/MSYS2/PowerShell path handling. If helpful, I’d appreciate a maintainer-side verification in a Windows WSL environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP "Show Logs" - wrong path with WSL / Debian Shell

1 participant