Repository navigation
fix(desktop): scope local tool restrictions to the invoking turn - #3780
Merged
Merged
Conversation
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.
Summary
Fix local DesktopCard creation/display and Creative frontend customization being rejected as Peer Device Mode whenever another device remains attached to the host. Attachments are event subscriptions and can outlive a switch back to the local desktop; they do not identify the caller of a tool.
The Peer host now stamps the submitting turn's origin. Both tools use that context, preserved through queued/persisted metadata, interrupted-turn recovery, subagents, session messages, and automatic goal continuation. Peer MiniApp/BTW submissions and direct tool calls retain an explicit unsupported result. Tool listing preserves origin booleans so availability and execution agree.
Type and Areas
Motivation / Impact
A local user can create or show cards and customize the frontend while a Peer controller stays connected in the background. An actual remote controller cannot create a card or change the frontend on an unseen host desktop. Older controllers do not need a new payload field: the receiving host supplies the origin, and legacy local requests remain valid.
Verification
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git,tools-creation --lib -- desktop_card frontend_workbench— 45 passed.cargo test --locked -p openbitfun-desktop --no-default-features --lib -- desktop_cards frontend_workbench— 50 passed.cargo check --locked -p openbitfun-desktop --no-default-features --lib— passed.pnpm run fmt:rsandgit diff --check— passed.The fixtures cover simulated Peer/mobile control origins, remote-workspace command-source refusal, legacy payload/record compatibility, and context propagation. No live SSH, relay/mobile, Peer Device, or Detached Dispatch integration was exercised; native card windows were not launched.
Reviewer Notes
AI-assisted. Testing level: lightly tested (focused automated checks, no native/remote manual pass). No card-store schema, controller attachment lifecycle, or command-registry changes.
Checklist