Repository navigation
fix(agents): preserve admitted CLI session context - #130475
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 8:52 PM ET / August 27, 2026, 00:52 UTC. ClawSweeper reviewWhat this changesThe PR makes CLI fallback runs capture one session entry only after placement admission and use it for permission grants, node placement, context window, and native CLI resumption. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking defect was found in the repaired branch: it moves the CLI session snapshot to the post-admission owner boundary and preserves it through grant and node execution. This recent maintainer-owned PR remains necessary because current main still has the pre-admission capture; exact-head CI is still in progress. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAuto-reply selects a provider fallback for an admitted agent turn. For CLI-backed candidates, the admitted session entry feeds both the loopback tool grant and any paired-node CLI invocation. flowchart LR
A[Auto-reply turn] --> B[Fallback candidate]
B --> C[Placement admission]
C --> D[Current session snapshot]
D --> E[CLI grant and resume binding]
E --> F[Local or paired-node CLI run]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -62, Tests +151. Total +89 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the post-admission single-snapshot flow so the CLI grant, resume binding, and paired-node target always describe the same admitted session state. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible. The focused regression changes the active session entry while placement admission waits and demonstrates the old/new binding divergence that current main permits. Is this the best way to solve the issue? Yes. Capturing the entry only after the placement owner admits the turn is the narrow canonical boundary; moving the read earlier in fallback selection would retain the race. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 42112dd86ec3. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
History |
|
Resolved the exact-head P1 on the new child commit. The CLI candidate now reads one active The added regression replaces an old native binding and node placement while admission is waiting. It failed before the repair by capturing the old native session with the new node, and now verifies that the CLI run and node resume arguments use only the newly admitted binding. Fresh proof on the complete repaired diff: focused stale-binding regression green; owner/cleanup guards 41/41; node invocation 29/29; node-resume preparation green; scoped lint and production/test types green; full changed gate green; autoreview clean at 0.94; independent final review GO. Combined production delta is +88/-150 (net -62), and tests are +157/-6 (net +151). Exact-head hosted CI is now running. The local paired-node authenticated transport proof remains green; no dependency-overlay files are included in the PR. |
|
Resolved the current-main merge-ref type failure on child commit The new node-resume regression had manually copied The test now builds its context through the canonical Proof: focused admitted-session regression green; original owner suite 16/16 and full changed gate green; fresh autoreview clean at 0.95; the identical test patch applied to a synthetic current-main + PR merge passes the focused regression and core test types. Final PR metrics are production +88/-150 (net -62), tests +157/-6 (net +151), total +245/-156 (net +89). Two prior manual release-gate oxlint jobs were also terminated by GitHub-hosted runner shutdowns without diagnostics; their actual ratchets passed. The new child head is receiving ordinary pull-request CI, which is the authoritative landing gate. |
|
Final exact-head merge gates are satisfied on
Native preparation will refresh the current-main merge snapshot and revalidate the reviewed head before merge. No rebase or source change is being used to bypass drift. |
|
Merged via squash.
|
* fix(agents): preserve admitted CLI session context * fix(agents): snapshot CLI session after admission * test(agents): reuse prepared CLI fixture
… suite Upstream openclaw#130475 grew agent-runner-execution-cli-sessions.test.ts past the 1000-line oxlint cap once this PR's cases merged in, and it moved the replacement-drop cleanup assertion inside the placement admission callback, where it still expected the binding record to vanish outright. Move this PR's auth-boundary case into agent-runner-execution-cli-session-auth.test.ts and update the relocated assertion to the unknown-provenance tombstone this PR keeps.
What Problem This Solves
Fixes an issue where an auto-reply run admitted with a specific session permission and placement could lose that context when the fallback cycle selected a CLI candidate. The CLI candidate previously received no admitted
sessionEntry, so its real grant projection and permission cache could diverge from the admitted run.The first repair exposed a second ordering hazard: placement admission can wait behind another turn, but the CLI resume binding was still captured before that wait. A replacement could therefore combine a newly admitted node placement with a stale native CLI session ID.
Why This Change Was Made
Fallback candidates now share one typed admitted-session context. Inside the placement-admitted callback, the CLI candidate reads one current
SessionEntrysnapshot and derives the permission grant, placement, context window, resume binding, and dropped-replacement state from that same snapshot. The existing expected-session-ID cleanup guard remains intact.This keeps the admission owner authoritative without changing fallback ordering, provider selection, executable command behavior, or the Codex protocol.
User Impact
CLI fallback runs preserve the session's admitted read-only/full permission, placement, and native conversation binding instead of silently rebuilding a mixed candidate from state captured on opposite sides of the admission wait.
Evidence