Repository navigation
fix(chat): relay remote crew approvals - #10638
ashvinnihalani wants to merge 1 commit into
Conversation
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of
Design-Verdict: CONCERNS Sound peer-authoritative relay closing a documented gap, but the rollback mechanism restores peer-global state a scoped transition never touched. Watch
Suggestions
[DESIGN-REVIEWED] 70b3d4d |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of All checks are done: the deleted KNOWN GAP pin in First-Principles-Verdict: CONCERNS The id-keyed first-match resolve this PR fixes on the HTTP route still runs unguarded for its 2 Slack callers — a remote mirror can settle locally with no peer forward. Not justified as shipped
What this change shipsInventory (10 items) — 7 justifiedIntent: let a person answer a remote crew's permission request, and make mode changes reach the gateway that runs the tool — a FIX (deleted KNOWN-GAP pin in
More micro-items exist ( Watch
[FIRST-PRINCIPLES-REVIEWED] 70b3d4d |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 4 of 4 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/dashboard/remote_relay.py:869 -- A truncated success response leaves peer auto-approval enabled BLOCKING -- src/kiro_crew/dashboard/chat_handlers.py:9798 -- Stale rollback can resurrect YOLO BLOCKING -- src/kiro_crew/dashboard/chat_handlers.py:9831 -- Rollback bypasses the current duration ceiling BLOCKING -- src/kiro_crew/dashboard/chat_handlers.py:10549 -- Failed peer YOLO extends an existing hub grant [BLOCK-MERGE] 70b3d4d Adjudication (Opus 4.8) — is blocking on each finding proportionate?The adjudicable input block is empty; all four findings are FENCED (annotate-only, unbounded-harm class). I verified each against the patch and the base tree. F1 F2 F3 F4 For every finding the triggering conditions (network truncation, concurrent mode change, policy revocation in-window, extend-then-fail) are plausible in real operation and non-contradicting, and the harm is YOLO/governance-ceiling persistence — the class where a wrong clearance is unrecoverable. No FLAG record can be completed. When torn: UPHOLD-FENCED. |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsThe sole candidate concerns the remote-slot trust flow in Falsifying it: the hub's permission card is a verbatim mirror of the peer's
So the deny-after-peer-accept branch requires the hub and peer to read different grant fields for the same No other defect meets the bar in the changed lines. No findings. [OPUS-REVIEWED] 70b3d4d |
ec9c541 to
d7caed1
Compare
952e481 to
c5a748c
Compare
c5a748c to
6cddcbf
Compare
Remote-bound chats showed permission requests on the execution peer only, so the gateway that owned the UI could not answer them. Approval-mode changes also stopped at the jump host.\n\nMirror peer permission requests into the owning slot, forward approval decisions and every supported mode to the execution peer, and fence relay teardown against in-flight responses. Preserve owner checks, collision priority, retryability, and one-shot rejection semantics.
6cddcbf to
70b3d4d
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author. Assessment: All 82 non-review checks are green on Fix plan: rebase onto main (736 behind), resolve those three hunks as unions, restructure the rollback record per the four remedies above with regression tests, then disposition the advisory items — Design's live hub→peer-over-a-real-tunnel verification and First Principles' ask to move forwarding into If you'd prefer I don't touch this PR, add the |
|
Hi @ashvinnihalani, thank you for this fix and for the careful write-up on #10618. This branch had gone conflicting with main and idle, so we took it over and redid it fresh on current main in #16509. Your commit authorship is kept with a The new version keeps your core design (mirror the peer's pending approval as a local card, forward the decision and the mode change to the peer first). It leaves out the rollback-token protocol, which is where the GPT lane's four blockers sat: a refused peer call now changes nothing on either side, so there is nothing to roll back. We will close this PR once #16509 merges. Thanks again! |
|
Hi @ashvinnihalani, a quick update on this one. We redid this fix on current main in #16509, building on your design. While that was in review, the project picked a different model for remote crews: the remote-crew sidebar RFC (#16489). In that model, a crew session is a window onto the peer's own slot, and approvals go straight to the peer (migration wave 3). The approval-mirror approach in both #10638 and #16509 is therefore superseded, and #16509 has been closed. None of this work is wasted. Your write-up of the gap and the bugs #16509 found (listed in its closing comment) are the checklist wave 3 will use. Thank you for taking this on. |
|
Hi @ashvinnihalani, a heads-up: #17662 (stacked on #17642) retires the hub-side turn relay that this PR built on. Under the accepted remote-crew sidebar RFC, a session on a crew is now owned by that crew and opened here through its window, so relay approvals have no path left to land on. Thank you again for this work. It shaped how we thought about approvals across machines, and it helped us get to the window design. |
|
Thank you @ashvinnihalani for this PR. Your work on relaying remote crew approvals helped shape the remote-crew-sidebar RFC. That RFC has now landed, and it makes this PR moot. Approvals now run on the peer's own session through the crew window (#16757), so there is nothing to relay. #17662 deleted the relay path ( I am closing this as superseded. The branch is left in place. Thanks again for the work and the ideas it fed into the design. |
Problem / Motivation
A chat can run on a second gateway while its session and approval UI stay on the first gateway. Permission requests reached the first gateway as transcript rows, but they had no approval future there. Approval-mode changes also stayed on the first gateway.
The person saw a request they could not answer, or changed a mode that did not change the gateway running the tool.
Why it matters
Remote crew chats can stop forever at a permission request. They can also run with a different approval mode than the one shown by the session UI.
What changed (motivation → approach → change)
The gateway that owns the UI now mirrors each peer permission as a local approval future. The gateway that runs the tool still owns the final decision.
The UI gateway sends Allow, Reject, Reject once, trust actions, and every mode change to the execution gateway first. It changes local state only after the execution gateway accepts the request. Owner checks, request-ID priority, retry behavior, and teardown cleanup stay in place.
flowchart LR subgraph Before A1[execution gateway asks]:::ctx --> B1[jump gateway relays text]:::changed --> C1[approval cannot return]:::removed end subgraph After A2[execution gateway asks]:::ctx --> B2[jump gateway mirrors approval]:::added --> C2[person decides]:::ctx --> D2[jump gateway forwards control]:::added --> E2[execution gateway resolves]:::changed end classDef added fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:2px classDef changed fill:#FEF3C7,stroke:#D97706,color:#78350F,stroke-width:2px classDef removed fill:#FEE2E2,stroke:#DC2626,color:#7F1D1D,stroke-dasharray:4 3 classDef ctx fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E linkStyle 0,1 stroke:#DC2626,stroke-dasharray:4 3 linkStyle 2,3,4,5 stroke:#16A34A,stroke-width:2px🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged
The jump gateway now carries the decision back to the gateway that runs the tool.
Tests
Manual verification
Not yet run on three live hosts. The tests exercise both gateway handlers and the network-race boundaries directly.
Related Issues
Fixes #10618
Pattern harvest
Rule candidate: review-prompt
Pattern: A relayed control plane must cover every supported mode and decision, and the execution owner must accept before UI-owner state changes.
Checklist