Repository navigation
feat(codex): route backend-authorized turns to Luna Reserve - #153113
roboclaw-bot wants to merge 5 commits into
Conversation
Add account-bound pending-turn Reserve entry and recovery, accepted native settings synchronization, preserved return state, and effective-route attribution. Keep passive usage reads and native-owned sessions outside capability opt-in. Add mocked owner and attempt-caller coverage. This candidate remains draft until genuine eligible-account routing and recovery, remaining caller/UI evidence, and current-head gates are validated. Related: #152338 Co-authored-by: fuller-stack-dev <[email protected]>
|
🦞👀 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: blocked before merge. Reviewed October 6, 2026, 2:39 PM ET / 18:39 UTC (Revision 7). ClawSweeper reviewWhat this changesThe Codex plugin adds backend-authorized Luna Reserve routing, account-bound recovery state, effective-model reporting, and native protocol and upgrade coverage. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 6 items remain This remains distinct, useful routing work: current main and the latest release provide disclosure only. The prior ordinary-turn availability finding remains unresolved, and the protected PR still needs the stated genuine-account landing evidence. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin sends OpenClaw’s selected model and pending input to the native Codex app server. This change checks backend account permission before submission and preserves the ordinary route needed for later recovery. flowchart LR
A[Selected model and pending input] --> B[Codex plugin]
B --> C{Current account and backend offer}
C -->|Reserve authorized| D[Saved ordinary return target]
C -->|Ordinary route| E[Native turn submission]
C -->|Unconfirmed authority| F[Held input and recovery guidance]
D --> E
E --> G[Reply and effective model]
Decision needed
Why: The branch deliberately trades existing availability for protection against uncertain credit spending; the captured discussion does not establish maintainer acceptance of that changed default. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +2384, Tests +1510, Docs +79. Total +3973 across 28 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep routing in the Codex plugin, preserve ordinary submission with a visible warning when no Reserve intent or offer is known, and retain strict account-bound recovery checks backed by approved-account validation. Do we have a high-confidence way to reproduce the issue? Yes for the introduced availability defect: the quota-read catch path and registered-caller internal-error case show that ordinary native submission is skipped. No tests or target code were executed during this read-only review. Is this the best way to solve the issue? Not yet. The native, account-bound plugin integration is appropriate, but the no-state failure policy needs repair or explicit acceptance before it is a safe replacement for existing ordinary submission. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 10334ec913d7. LabelsLabel changes: No label 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
HistoryReview history (6 earlier review cycles)
|
Admit native settings and pending input atomically through turn/start. Retain account and binding authority across initial submission and overload retries, and preserve accepted-turn interruption and persisted recovery intent. Distinguish revoked prior ChatGPT authority from genuine API-key clients before selection. Add native-binary, caller transport, persistence, fork, and auth regressions. Positive eligible-account Reserve validation remains a landing prerequisite. Related: #152338 Co-authored-by: fuller-stack-dev <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Exercise actual published v2026.9.5 producer state through the registered candidate harness, including ordinary resume, offered Reserve entry, storage reopen, guarded recovery, and explicit new sessions. Keep the historical schema and synthetic rows in a complete reviewable SQL snapshot; preserve producer provenance and verify schema/data equivalence to its original SQLite output. No production behavior or policy change. Related: #152338 Co-authored-by: fuller-stack-dev <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Merge current main and preserve its home-scope isolation, model execution authority, native process ownership, and provider-review continuation. Persist Reserve acceptance through a detached record, publish the accepted model after final guarded admission, and hold pending input while a prior native turn remains unconfirmed. Retain the published historical fixture while allowing the core-owned state migration before checking Reserve lifecycle invariants. Related: #152338 Co-authored-by: fuller-stack-dev <[email protected]>
Merge current main while retaining its shell-path environment forwarding and both sides of the database-worker test list. The Reserve feature added/removed lines are unchanged from the reviewed integration. Co-authored-by: fuller-stack-dev <[email protected]>
|
Closing this stale draft; it can't be validated without a genuine account, and the review finding is still open. |
Related: #152338
Builds on disclosure already landed in #152383.
What Problem This Solves
OpenClaw does not transition an eligible pending Codex turn to Luna Reserve when the backend authorizes that separate route.
User Impact
Draft — do not merge until genuine-account routing validation succeeds. This adds account-authorized Reserve entry and ordinary recovery for persistent OpenClaw-owned ChatGPT conversations while preserving explicit model and Fast preferences. API-key, native/adopted, and incognito ownership boundaries remain unchanged. Recovery can use available credits under provider spending controls; it is not a promise of free included usage.
The existing conservative contract is retained: only typed pre-enqueue usage overload can continue the selected ordinary model before any saved Reserve state or known offer. Authentication, timeout, transport and ambiguous quota failures hold input. Saved Reserve intent prevents silent ordinary replacement of an unavailable native thread; reconnecting the original account or explicitly starting a new conversation remains available. No opt-in redesign, public setting, Reserve-specific SQL migration, or independent dependency bump was added.
Why This Change Was Made
Native
turn/startadmits complete settings and pending input together. The plugin saves return intent before dispatch, validates live account/run/thread/binding authority through transport retries, and publishes accepted state only after guarded native acceptance. It never relies on a change-only settings notification or quota percentages as permission.The current-main refresh resolves the three merge conflicts while preserving main’s home-scope isolation, exact tuple/model-policy checks, native-process ownership and provider-review continuation. Actual caller regressions exposed and repaired three integration problems: acceptance mutating an immutable model tuple, ordinary-model attribution after Reserve acceptance, and an unconfirmed active native turn receiving transition input as a steer. That last case now keeps pending ChatGPT input unsent. Small metadata/path helper extractions preserve their existing ownership and lifetime.
Evidence
Current head
bf0232649376aa7ab419d95083d8f763b22ab185, tree53b51c2ab539ae55133db65293a6cde6d869c8c7, integrates main229ab8a1fe957d3d4822309a39ddf9c7ec616395. The final merge preserves main’s native shell-environment forwarding and combines both test-routing additions. All Reserve feature added/removed lines are identical to reviewed commitce158c0ff6624990f16f348b0a302ec2a1dd84ffrelative to its base2ef3b4a0fddeeb0b24542e4840a7e9f1db37afeb.bf0232649376.pnpm buildcompleted in 8m15.1s on integration commitce158c0ff6624, tree2d527a0b079bbe538605ca80b33740519d8f0ed1. This is not a new full-build/CI claim for the later main-context merge.ce158c0ff6624: 25 production-caller/real-client cases, one actual native-binary loopback case, three registered upgrade cases, and 17 provider-review cases.Crabbox run 36079282899 used the configured
blacksmith-testboxprovider. The wrapper verified the exactce158c0ff6624source/tree; native and credential scratch cleanup succeeded, and provider readback confirms the owned Testbox completed. The Actions job can show cancellation during normal external Testbox cleanup; the retained terminal wrapper/build/test receipts are the execution evidence.Actual Codex 0.155.1 was source-checked at
be2951ea34f0d295ed0becf97079f92fa5f6950e. Its loopback test completed two turns/two backend requests, normalized null/default settings and emitted one change notification. This verifies native protocol behavior, not genuine account eligibility or billing.The historical fixture still comes from executing the published v2026.9.5 producer at
ec9c1a13db8938e5a3eaa51fca2e981cde2395a9. Its complete readable SQL snapshot is unchanged. The refreshed registered-caller tests admit the core-owned schema 17→18 migration, preserve the complete old binding row, and verify that Reserve introduces no further schema migration. They cover entry/reopen/recovery, unknown permission/missing-thread refusal, and explicit new-session escape. This is published-source-owner × candidate compatibility, not a full installed-package updater test.Sanitized current-tree execution receipt
The wrapper completed the diagnostic and independent checks successfully; that does not turn its negative authentication result into a successful login.
Remaining landing gate
The September 25 native attempt used the approved CI-hydrated ChatGPT fixture and preserved the supported transport path. Automatic token renewal was rejected with HTTP 401, before quota lookup or inference. The corrected diagnostic retained that status; it did not establish expired/reused/revoked as the specific grant failure. No credentials, raw errors, account identifiers or private endpoints were published.
The existing approved CI login must be validated/renewed before genuine backend-authorized Reserve entry, continuation, recovery and effective-route presentation can be exercised. No host-credential copying, API-key substitution, JWT rewriting, client spoofing, hidden-route forcing or quota depletion was used. Required exact-head GitHub CI and native landing gates remain pending while this PR is draft.
Reported by @saariuslystoned in the linked issue.
Worked on by
Work sessions
View the OpenClaw team session