Repository navigation
fix(core): honor host authority across approved resumes - #200
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed October 6, 2026, 4:46 PM ET / 20:46 UTC (Revision 6). ClawSweeper reviewWhat this changesLobster rechecks host authority before resumed process, network, and state effects and restores safe approval checkpoints when an invocation retires. Merge readiness⛔ Needs changes before merge - 1 item remains The change remains necessary: current main lacks these host-authority checks. The production-path proof supports rejection, safe recovery, and replay prevention, and no actionable patch defect was found. The PR remains a draft. Priority: P2 Review scores
Verification
How this fits togetherLobster runs typed pipelines and workflow files for CLI and embedded hosts. Approval resumes load saved checkpoints, then either dispatch permitted effects, publish another gate, or finish the workflow. flowchart TD
A[Host resume request] --> B[Saved approval checkpoint]
B --> C[Claim checkpoint]
C --> D[Check current host authority]
D --> E[Process network or state effect]
D --> F[Restore safe checkpoint]
E --> G[Finish or publish next gate]
F --> H[Retry through current host]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Retain optional host checks at built-in effect boundaries, restore only safe caller-owned checkpoints, and preserve non-replayability after dispatch. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the gap: main cannot recheck a host predicate after awaited resume preparation or before built-in effects. The contributor's gated production-path scenario exercises these retirement windows; this review did not execute it. Is this the best way to solve the issue? Yes. An optional host callback extends the existing cancellation and checkpoint machinery while retaining callers that supply no predicate, and claim-specific rollback avoids restoring an already-dispatched approval. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 74db2679fe34. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Real loopback HTTP authority proof is now on this PR at |
b1f28ba to
325717a
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 325717a693
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| assertInvocationCurrent?.(); | ||
| if (command.meta?.resumeSafeBeforeInput !== true) onUnsafeCommandDispatch?.(); |
There was a problem hiding this comment.
Recheck authority after state-read lock waits
For an approved pipeline ending in state.get, this check runs before stateGetCommand waits in readRememberedState's file lock. If the host retires the invocation while that lock is contended, the command still performs the read and returns successfully after the lock is released; line 159 has already classified the stage as unsafe, so terminal finalization consumes the approval without another authority check. Recheck assertInvocationCurrent inside the locked read task (or immediately after the wait) so a retired invocation cannot complete this built-in state effect.
Useful? React with 👍 / 👎.
Approved resumes can outlive the host invocation that authorized them while awaiting state reads, locks, or checkpoint publication. Add the optional synchronous
ctx.assertInvocationCurrentcallback to the core tool API and recheck it at built-in process, network, state, and workflow-shell effect boundaries. CLI behavior stays unchanged when the callback is absent.Retirement before unsafe dispatch restores caller-owned approval/input claims and the original short approval ID without overwriting a competing mapping. Partial successors are discarded. Once unsafe dispatch starts, the checkpoint stays consumed to prevent replay; entering an unsafe pipeline command remains a conservative boundary even if a later effect-site check stops its I/O. Custom commands and injected adapters must cooperate with the callback, and the SDK does not expose this contract. The README documents these boundaries.
The compiled main baseline reproduced a retired host still executing a resumed command. The regression suite covers awaited preparation, locks, atomic publication, successor handoff, terminal cleanup, workflow loops/parallel branches, and real loopback HTTP through
runToolRequest/resumeToolRequest: current dispatch 1; retired-before-I/O 0; byte-identical safe checkpoint restored; recovered dispatch 1; dispatched-before-retirement 1; replay 0. This is synthetic loopback transport proof, not a live Gateway test; the related integration is openclaw/openclaw#163307.Validation: AWS Crabbox frozen install, build, CLI doctor, typecheck, lint, and all 726 tests passed without skips. Independent Codex P0–P2 reviews found no actionable defects. GitHub CI checks Node 22/24 and workflow syntax. Thanks @Patrick-Erichsen; the original implementation and test commits are preserved in the branch, and the Unreleased changelog records the fix.