Skip to content

fix(sftp): preserve browsed paths across tab snapshot transitions - #3296

Open
binaricat wants to merge 1 commit into
mainfrom
codex/smoke-sftp-tab-follow
Open

fix(sftp): preserve browsed paths across tab snapshot transitions#3296
binaricat wants to merge 1 commit into
mainfrom
codex/smoke-sftp-tab-follow

Conversation

@binaricat

Copy link
Copy Markdown
Owner

Summary

Switching away from an SSH terminal and back could still reset its SFTP browser to the terminal cwd and clear its filename filter, despite #3232. The panel briefly consumed the previous tab's live context before the new tab's publisher committed, invalidating cwd tracking and sometimes replacing the SFTP connection.

Keep each panel's last matching terminal/workspace snapshot during that publication gap. Unrelated snapshots are ignored, fresh panels wait for their owner, and actual cwd or focused workspace-pane changes still propagate.

Type of Change

  • Bug fix

Related Issue (optional)

Follow-up to #3232; related to #3230.

Changes Made

  • Match live snapshots to the owning standalone terminal or workspace.
  • Retain only a matching snapshot during a tab reveal; clear the fallback when the hook owner changes.
  • Add tests exercising the actual production subscription hook, including stale publication, new mounts, workspace focus changes, and owner changes.

Screenshots / Demo

Reproduced twice in the actual npm run dev Electron app against an SSH host: enable follow terminal directory, browse a different folder, filter to one file, switch to a local tab and back. Before the fix the path returned to /root and the filter disappeared. A temporary trace showed the local tab's focused session entering the remote panel before its own snapshot arrived; no panel remount was required.

After the fix, the same UI steps preserved the folder and filter. A real cd still moved the SFTP browser to the new directory. Final source was retested in the development app. Diagnostic logging was removed.

Testing

  • I have tested these changes locally (npm run dev)
  • Linting passes (npm run lint)
  • Tests pass (npm test) — full suite not rerun
  • Generated capability tool specs are updated when applicable (npm run generate:capability-tools) — not applicable
  • No new console errors or warnings, if this affects app behavior — existing development warnings were present

124 focused tests pass across live snapshot isolation, SFTP follow, connection reuse/memory, side-panel wiring, and the tab bridge. The new regression test was run against the old hook and failed because local-b reached the ssh-a panel; it passes with this fix.

Checklist

  • My code follows the existing project style
  • I have added or updated relevant documentation — reproduction and validation recorded here
  • I have not introduced any breaking changes

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T10:12:22.782813Z 03066c1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@binaricat binaricat added the automation:codex-loop Own/bot PR waiting on Codex review↔fix loop label Sep 6, 2026
@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@binaricat
binaricat marked this pull request as draft September 6, 2026 10:10
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 03066c181e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@netcatty-bot
netcatty-bot marked this pull request as ready for review September 6, 2026 10:12
@netcatty-bot netcatty-bot added automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Sep 6, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator

Codex reported no major issues. This PR is marked ready for human review/merge.

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

Labels

automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants