feat: one delivery throne — intent, not focus - #76
Conversation
There was a problem hiding this comment.
An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.
Once the cap resets or is raised, reopen this pull request to trigger a review.
There was a problem hiding this comment.
Pull request overview
This PR centralizes “where the transcript lands” into a single routing function so delivery is determined by session intent, not whichever app happens to be frontmost at stop time. It introduces a dedicated delivery-route module and updates stop-path delivery to restore and validate the latched target before any synthetic paste, preventing accidental raw-tag pastes into Codescribe UI surfaces.
Changes:
- Add
app/controller/delivery_route.rsdefiningDeliveryIntent→DeliveryRouteresolution plus stable telemetry formatting. - Update the stop path in
app/controller/mod.rsto consultresolve_delivery_route, logdelivery_route: …, and only attempt paste after re-activating the latched target and passingoverlay_paste_dispositionpreflight. - Document the destination contract in
docs/DELIVERY_ROUTE.mdanddocs/HOTKEYS_CONTRACT.md, and broadcast the change onAGENT_BUS.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/HOTKEYS_CONTRACT.md | Documents the updated hotkey contract: intent selects destination; focus-at-stop is not an input. |
| docs/DELIVERY_ROUTE.md | Introduces a destination-only “delivery route” contract and expected telemetry. |
| app/controller/mod.rs | Wires stop-path delivery through resolve_delivery_route, restores latched target before paste, adds route telemetry. |
| app/controller/delivery_route.rs | New single-source-of-truth routing module with intent/route enums and unit tests. |
| AGENT_BUS.md | Records the “delivery route throne” signal to peers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
9f91c3d to
68746cb
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
app/controller/mod.rs:4284
resolve_delivery_routewill chooseClipboardPastewheneverauto_paste_enabledis true, even if there is no latched target (pre_overlay_frontmost_appisNone). That contradicts the contract indocs/DELIVERY_ROUTE.md(“ClipboardPaste if auto‑paste + latched foreign app; else OrientCanvas”) and produces misleading telemetry likeroute=clipboard_paste … target=-, plus it unnecessarily enters the paste branch only to degrade to clipboard copy.
auto_paste_enabled: config.auto_paste_enabled,
app/controller/mod.rs:4391
- This log line starts with the
delivery_route:prefix but does not follow the documenteddelivery_route: intent=… route=… reason=… target=…format, so grepping/parsing for delivery-route telemetry will pick up an extra, incompatible record. Consider removing thedelivery_route:prefix (or emitting this as a different event name).
"delivery_route: synthetic paste refused; clipboard copy only"
Destination is a single function. The stop path no longer pastes into whoever is frontmost, which is how tagged raw landed in the Agent composer. - resolve_delivery_route is the only king on this axis - Assistive / To Agent → AgentComposer (first-class message) - Hold Fn + latched Codescribe → OrientCanvas (refuse_paste_into_self) - Auto-paste activates the latched target and fail-closes to clipboard copy - Telemetry: delivery_route: intent= route= reason= target= Mic lock, transcript truth, and agent-chain memory stay other thrones. Authored-By: grok <agents@vetcoders.io>
68746cb to
90446f0
Compare
Summary
Stacked on
fix/engine-routing(the PR 74 tip). One axis only: where the transcript lands.The stop path used to paste into whoever was frontmost. That is how tagged raw (
<codescribe mode="raw">) landed in the Agent composer when Hold Fn fired with Codescribe focused. Destination is now a single function. Focus at stop is not an input.User Impact
refuse_paste_into_self). No more tagged dump into chat.Runtime Impact
Contract
docs/DELIVERY_ROUTE.md+resolve_delivery_routeinapp/controller/delivery_route.rs.Telemetry (one INFO per stop / To Agent):
What this cut does not do
Mic lock, transcript adjudicator (Apple/Whisper/Final/Toggle), and agent-chain memory stay other thrones. Do not bundle them here.
Verification
rustc --edition 2024 --test app/controller/delivery_route.rs— 11 passedcargo fmt --all/cargo clippy -- -D warnings/cargo test— not run on this host (no glib / not macOS). Operator box.make verify— operator boxLive tell: Hold Fn with the Agent window focused. Overlay keeps the text. Chat does not grow a
<codescribe mode="raw">paste. Line in the log isreason=refuse_paste_into_self.Release Notes
Authored-By: grok agents@vetcoders.io