fix(ui): resolve tool-call paths against the live workspace#18
Merged
Conversation
Local-only folder for feature mockups and design sketches; never tracked. Replaces the single thinking-trail-preview.html ignore entry.
The tool-call summary line showed a `path` argument resolved workspace-relative using a workspace captured once at UI construction, so after a mid-session `/cwd set` it resolved against the stale old workspace. The approval-panel display and the tool action itself already used the live per-turn workspace, so this was a display-consistency gap, not a security issue. AppUI and TerminalUI now take an optional workspace_fn, evaluated at render time, wired to `lambda: runtime.status().workspace`. The build-time workspace stays as the fallback for test doubles. Mirrors the existing status_fn/runtime.status() live-value pattern; the approval display and secret redaction are untouched.
lavindeep
added a commit
that referenced
this pull request
Jul 2, 2026
fix(ui): resolve tool-call paths against the live workspace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tool-call summary line resolved a
pathargument workspace-relative using a workspace captured once at UI construction, so after a mid-session/cwd setit resolved against the stale old workspace. The approval-panel display (executor._display_value) and the tool action itself already use the live per-turn workspace — so this was a display-consistency gap, not a security issue (the security-critical surface was already correct).Fix
AppUIandTerminalUItake an optionalworkspace_fn, evaluated at render time in_tool_call_value, wired at the production construction sites tolambda: runtime.status().workspace(the live workspace, updated byset_workspace). The build-timeworkspacestays as the static fallback for test doubles. Mirrors the existingstatus_fn/runtime.status()live-value pattern. The approval display, secret redaction, and theRuntimeUIprotocol are untouched (constructor-only param — noFakeUI/ThreadedUIchange).Also closes the latent
workspace=Noneseam in practice: production now always wires a liveworkspace_fn, so the verbatim-path fallback only remains for test doubles.Verification
mypy --strict/ 1453 pytest.test_tool_call_path_uses_live_workspaceintests/test_app_ui.pyandtests/test_terminal_ui.py— a path inside workspace A but outside its subdir B; after the live workspace flips A→B, the second tool-call line shows<outside workspace>, proving live (not stale) resolution. Deterministic; no live model needed.(The first commit is unrelated repo hygiene: gitignore a local
prototype/mockups folder.) Targetsui-rework. Does not touchmain.