Repository navigation
Let agents point you at the diff, a file line, or the terminal - #1696
Conversation
…293) New coder-threads tool show_user (target diff | file | terminal). The host validates the path against the thread workspace; the renderer reads the result off the tool card, opens the pane when the card streams in live on the open thread, and otherwise leaves a Show button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f2fde92ef
ℹ️ 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".
| * renderer reads this result off the tool card and opens the pane. | ||
| */ | ||
| async function show_user(args) { | ||
| requireOwnThread(args); |
There was a problem hiding this comment.
Bind show_user to the calling thread
When a bound MCP client supplies the ID of another thread in the same project, requireOwnThread accepts it because it checks only project membership. Path validation then uses the other thread's worktree, while the resulting card remains in the caller's transcript and opens the caller's panes, so it can reveal the wrong same-named file, fail unexpectedly, and probe whether paths exist in sibling worktrees. Validate args.threadId against boundThreadId, as the other self-only handlers do.
Useful? React with 👍 / 👎.
| // eslint-disable-next-line react-hooks/exhaustive-deps -- reveal is the trigger | ||
| }, [reveal]); |
There was a problem hiding this comment.
Reapply the reveal after the requested file loads
When the Files pane already displays a text file and show_user points to another text file, Preview keeps the old text while the new read is pending. This effect runs immediately against those old lines; if the requested line exceeds the old file's length it returns, and because the effect depends only on reveal, it never retries when the new text arrives. The requested line is therefore neither selected nor scrolled into view for this common navigation path.
Useful? React with 👍 / 👎.
| <TextPreview | ||
| path={path} | ||
| text={state.preview.text} | ||
| reveal={reveal} | ||
| onAddToPrompt={onAddToPrompt} |
There was a problem hiding this comment.
Honor line reveals for Markdown files
For a .md or .markdown target with a line number, the default branch renders MarkdownBody; the new reveal value is passed only to TextPreview in the alternate source branch. Consequently, pointing at a line in a Markdown report—one of the advertised artifact use cases—opens the document but never highlights or scrolls to the requested line unless the user manually switches to Source.
Useful? React with 👍 / 👎.
Agents can now steer your attention instead of describing things in text. A new coder-threads tool,
show_user, opens the Git pane on a changed file, opens the Files pane on a file with a line highlighted (this also covers artifacts like reports and screenshots), or opens the Terminal pane. Closes #293.Changes
show_userMCP tool (target: diff | file | terminal, plus optionalpath,lineandreason). The host normalizes the path to workspace-relative. It refuses a path that escapes the thread workspace, and refuses a missing file forfile;diffmay name a deleted file.ask_user.Verification
npm run test:electronwith theCODER_*variables inherited from the running app stripped and a node-only PATH: 4957 tests, 4954 pass, 0 fail, 0 cancelled.npm run test:renderer: 3171/3171 pass.npx tsc --noEmitandnpx vite buildare clean.Notes for reviewers
terminalopens the pane but deliberately doesn't move keyboard focus out of the composer.claude-opus-5-5 via Claude Code
🤖 Generated with Claude Code