feat(selector): inline native path picker for ambiguous paths#212
Open
hazemahmedx0 wants to merge 4 commits into
Open
feat(selector): inline native path picker for ambiguous paths#212hazemahmedx0 wants to merge 4 commits into
hazemahmedx0 wants to merge 4 commits into
Conversation
Renders an inline picker inside the streaming assistant turn when the agent's select_path tool asks to disambiguate a path — never a separate chat bubble. - responseStreamAdapter: pure pendingSelection field; set on response.selection.requested, cleared on terminal events. - App: thread pendingSelection into the _streaming message (all stream paths). - api: submitPathSelection() POSTs the pick (or null cancel) to /responses/selection. - PathSelector: keyed-by-requestId card; on pick/dismiss it POSTs and collapses to a one-line confirmation while the agent continues. The choice returns as the tool result, so there is no synthetic user message.
PathSelector now navigates the filesystem (listDirectory) and selects a file or folder when the agent asks in browse mode; pick-mode candidate list unchanged. Reducer carries mode/root through pendingSelection.
Browse mode now opens the native Finder/Explorer via dialog.showOpenDialog (IPC dialog:pick-path → preload pickPath → host.pickPath), shown as a single "Choose folder"/"Choose file" button — like Claude Cowork — instead of an in-app file tree. The custom /fs/list browser is kept only as the web fallback (no native dialog in the browser shell).
Removes the in-app file browser and the listDirectory call so browse mode always goes through the native OS picker, matching how Claude Cowork does it. The submit now awaits the POST and shows an error if it fails instead of firing and forgetting, only swallows a real 404 as not-pending, and keeps the Thinking indicator hidden while a selection card is pending.
|
Automatic Review Skipped Too many files for automatic review. If you would still like a review, you can trigger one manually by commenting: |
Member
Author
|
@Entelligence review |
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.
This is the client half of the inline path picker. When the agent isn't sure which file or folder you meant, a small card appears inline in the chat, you pick, and the turn keeps going. No new message from you, no interruption.
Before
After
https://www.loom.com/share/5495d1aff1a7488db532fbdbd0f55926
What's in here:
PathSelectorcard that renders inline when the stream carries a pending selection. Pick mode lists the concrete candidates the agent found. Browse mode shows a button that opens the native OS picker.dialog:pick-pathIPC channel and main-process handler calldialog.showOpenDialog, so browse mode uses Finder or Explorer, the same way Claude Cowork's "Choose folder" does. No in-app file tree.A few things this revision tightens:
listDirectorycall are gone, so there's no second filesystem-listing path to maintain or secure.kindis "any", the card offers both Choose file and Choose folder. On the web (no native picker) it falls back to a clear "Desktop app required" note.Depends on the cowork-server selection endpoint and SSE selection events, which in turn depend on the anton
select_pathtool. Merge bottom up: anton, then cowork-server, then this.Tested end to end against the local stack.
Part of the inline path picker stack. Merge bottom up:
Related but independent: mindshub_inference #302 (https://github.com/mindsdb/mindshub_inference/pull/302) is the image side of the same multimodal and file effort. It translates image_url blocks for every provider and transcodes unsupported image types to PNG. It does not depend on this stack and this stack does not depend on it.