Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 7:56 PM ET / 23:56 UTC. ClawSweeper reviewWhat this changesAdds a Gateway RPC that restarts an active chat turn after a permission-mode change, with Control UI handling, protocol support, and Gateway/UI coverage. Merge readinessThe PR supplies a Gateway-owned, exact-run restart path for active-turn permission changes and now visibly rejects ambiguous active-run state; no introduced functional or security defect was found. Keep it open for normal maintainer review while exact-head checks finish. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI changes a session’s permission mode through Gateway session APIs. For an active chat turn, this change interrupts the exact running turn, applies the permission update, and continues it through the existing chat lifecycle. flowchart LR
A[Control UI permission picker] --> B[Active-run identity check]
B -->|one exact run| C[Gateway restart request]
B -->|zero or multiple runs| D[Visible unavailable message]
C --> E[Exact-run fence and authorization]
E --> F[Permission patch]
F --> G[Continuation through chat lifecycle]
G --> H[Refreshed chat and restart notice]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +446, Tests +683, Other +61. Total +1190 across 47 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the single Gateway-owned restart flow with its exact-run fence and visible ambiguous-ID rejection, then complete exact-head validation before landing. Do we have a high-confidence way to reproduce the issue? Yes—source and targeted Gateway/UI tests define a current path: change permissions while one exact chat run is active; this review did not execute the tests. Is this the best way to solve the issue? Yes—the Gateway-owned exact-run fence and internal continuation are safer than a UI-side abort/send sequence because authorization and lifecycle state remain at their existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4fd9392c209a. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
390e8b9 to
7e356b7
Compare
|
Addressed the latest ClawSweeper lifecycle findings in
Proof: This follow-up is production +97 net and tests +145 net. The production growth is the exact pre-publication identity fence, atomic recovery-claim handoff, and serialized successor identity required by the three distinct races; it reuses the existing chat-abort registry, restart-safe transcript transaction, and picker tail rather than adding a parallel lifecycle path.
|
|
Follow-up repair proof for exact head
Validation: OCM release-shaped proof: Exact-head CI run |
What Problem This Solves
Fixes an issue where changing a session's permission mode during an active turn only affected the next run. Users had to stop the turn manually and send
continueto make the new permission profile take effect immediately.Why This Change Was Made
Permission changes now use a typed Gateway-owned restart lifecycle: patch the permission mode, interrupt the exact active run, and resume from the existing transcript with trusted internal-system provenance. Exact run identity fences stale requests so they cannot interrupt a successor run, and idle sessions continue to update permissions without starting work.
The Control UI no longer synthesizes a visible user
continuemessage. It shows a system restart notice and keeps command interpretation and external delivery disabled for the internal continuation.User Impact
Changing permissions during an active turn now immediately restarts that turn under the selected profile. Users no longer need to stop the run and type
continuethemselves.Evidence
Real Gateway boundary:
node scripts/run-vitest.mjs src/gateway/server.chat.gateway-server-chat.test.ts -t "sessions.restartTurn"— 2 passed, covering exact-run restart and stale-ID non-interruption.Gateway owner tests:
node scripts/run-vitest.mjs src/gateway/server-methods/sessions-restart-turn.test.ts— 3 passed.Focused suites: gateway protocol 63 passed; reply-run registry 88 passed; Control UI 30 passed.
Browser flow:
OPENCLAW_CAPTURE_UI_PROOF=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.models-reasoning.e2e.test.ts -t 'restarts an active turn after changing its permission mode'— 1 passed, 12 skipped.Before (Guarded, active turn):
After (Workspace, restarted turn, no synthetic user message):
git diff --checkpassed.Mandatory autoreview passed with no actionable findings (confidence 0.99).
Known local gate gap:
node scripts/check-changed.mjspassed formatting, policy guards, and core production typecheck, then hit an environment-only core-test typecheck failure because this linked worktree resolved the parent checkout's stale[email protected]whileui/package.jsonrequires3.0.1.Production LOC: +351/-31 (net +320) | Tests/test support: +445/-34 (net +411). Production growth is the new typed Gateway protocol and lifecycle owner; the obsolete UI-authored stop/send path is removed.