Skip to content

fix(codex): preserve local native configuration across supervised turns - #151001

Merged
roboclaw-bot merged 4 commits into
mainfrom
galiniliev/codex-local-config
Sep 18, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
galiniliev/codex-local-config

Conversation

@galiniliev

@galiniliev galiniliev commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #101586

What Problem This Solves

Fixes supervised Codex sessions losing verified native tools over local Unix connections and requiring repeated policy handoffs when continuing with an existing local config.toml. Also fixes recoverable startup failures leaving a warm native thread stuck as active.

User Impact

Users can continue native Codex sessions through the running local App Server while Codex owns configuration loading, authentication, and model/provider selection. An absent or null model_provider preserves Codex's OpenAI default. Ordinary OpenClaw chats keep their explicit model routes. Existing native conversations retain their established search policy when daemon defaults change.

Initial adoption or a changed execution policy can still require an idle native configuration handoff; the setup documentation explains how to reconnect and retry. A shared daemon keeps its native account: model-locked Chats do not provide a separate login per user or fall back to OpenClaw credentials. The new credential-ownership table explains token handoff, refresh, storage, and account-switching limits.

Why This Change Was Made

Restore native tool catalogs for verified local Unix connections, distinguish the configured native provider from OpenClaw provider overrides, and reuse supervised sessions when their ownership and loaded policy are unchanged. Document the shared local daemon setup and move existing regression coverage into focused sibling suites.

Original implementation and native proof by @galiniliev; recovery and documentation follow-up requested by @steipete and @galiniliev.

Work sessions

Evidence

Recovery and credential documentation update

Commit 8cefc5caf84b2a32f66a6c4dc6572fc82e92f1c9 centralizes subscription settlement across startup and active-turn cleanup. Passive failures retain valid ownership; cancellation, revocation, replacement, and ambiguous turn-starts retain their existing safety boundaries.

  • Fresh pre-push validation passed 291 tests across the five affected ownership, native-config, and context-engine suites (248 Codex tests and 43 database-worker tests).
  • The production files match the previously validated and independently reviewed repair: 599 focused/sibling tests across completed runs, production/test typechecks, formatting/lint, selected guards, and P0–P2 autoreview. These are reused results for unchanged code, not a new full-suite run.
  • Credential documentation formatting, MDX, glossary, and whitespace checks passed. New links and anchors were verified, and the existing setup link was repaired. The full anchor audit still reports 56 existing failures; their source and target files are unchanged from the prior head. ClawHub fragments remain unverified without its separate source checkout.
  • The earlier optional broad run-attempt suite was stopped after Gateway-auth warnings. No live sign-in, account-switch, refresh, or billing test was performed for this update. The historical native proof below is explicitly scoped to its earlier commit.

Earlier revision evidence

Preparation fixes: 1089e22b55673c80faa4d7be94f6e87f48fc9ce9 correct the session-viewer instructions and preserve subscriptions for parent-controlled direct-input refusals. Both CI failures were reproduced locally; all 271 tests in the two affected owner suites now pass. Current production/test typechecks, formatting/lint, selected guards, and documentation links pass. Independent review found no actionable P0–P2 findings.

Review repairs: b62be2d80022696abc0febd1552e9db094a00190.

  • Review regressions reproduced all three reported defects before repair: incompatible legacy search policy, stale native model attribution, and subscription loss on active-thread refusal.
  • 98 selected behavior tests passed after repair, covering provider capabilities, native configuration, registered-harness model attribution, active-refusal/idle-retry behavior, and lifecycle/cleanup siblings.
  • Production/test typechecks, changed-file formatting/lint, and all selected repository guards passed on the repaired tree; documentation links have 0 broken targets.
  • Independent review confirmed the repairs and identified no additional P0–P2 defects. Findings against the old index were resolved by staging the reviewed working-tree changes.
  • Initial commit 3cdeef93e27 passed the full build (including Control UI), production/test typechecks, applicable guards/lint, 43 targeted tests, and documentation validation (0 broken links; 1,244 configuration examples).

The repairs preserve older supervised disabled-search policy when provider capabilities expand, refresh the stored and returned native model metadata during warm reuse, and retain verified subscriptions across active-thread refusal. A new branch can pick up newly advertised search support; existing bindings are not replaced.

Live native configuration proof

Tested 3cdeef93e27846d5487e9cde714803e0a3d39058 with its matching built runtime on macOS, using a fresh isolated Gateway profile and the existing native daemon over Unix transport.

  • The dashboard created a model-locked branch through sessions.catalog.continue. Three read-only turns completed in the same conversation, each with one canonical terminal assistant record (stopReason=stop) and no tool calls.
  • Native config/read, initial selection, native thread provider, and completed turn provider/model matched. The configured provider advertised search, and the binding retained the native cached-search policy.
  • After initial materialization, the second turn established the retained configuration. A passive second client then attached without configuration overrides and observed the third turn complete; only that test subscription was released.
  • The native config.toml checksum stayed unchanged. Missing/null provider behavior remains covered by the targeted regressions.

The dashboard branches when sending from the native session viewer; the setup documentation now describes that flow. The captures show duplicate displayed answer text, while canonical transcripts contain one terminal assistant record per run; rendering is outside this change.

The screenshots show the proof conversation before continuation and after the observed turn on the candidate build. Gray masks conceal private project, account, and model details.

Native proof session before continuation

Three completed proof turns, including passive observation

Extract Unix catalog restore and provider capabilities from cf7cc9764a8 and da98abc78ca, plus the native lifecycle portion of 0cf8f84c694. Preserve the native OpenAI default when model_provider is unset. Document the shared local daemon setup and move native configuration regressions into focused suites.
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@galiniliev
galiniliev marked this pull request as ready for review September 17, 2026 16:39
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: codex size: XL maintainer Maintainer-authored PR labels Sep 17, 2026
@galiniliev galiniliev self-assigned this Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 17, 2026, 10:08 PM ET / September 18, 2026, 02:08 UTC (Revision 5).

ClawSweeper review

What this changes

The Codex plugin preserves native configuration and tools across supervised turns, recovers retained subscriptions after startup failures, and documents shared-daemon credential ownership.

Merge readiness

⛔ Needs changes before merge - 1 item remains

The fix remains necessary, and no blocking code defects were found. Earlier review findings are addressed; the newly added startup-failure recovery still needs real behavior proof.

Priority: P2
Reviewed head: 8cefc5caf84b2a32f66a6c4dc6572fc82e92f1c9

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is coherent and prior findings are resolved, but real proof does not yet cover the newly added recovery behavior.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 9 items Current main still needs the fix: Current main rejects native catalog restoration whenever the transport is not stdio. The reviewed branch permits Unix transport while preserving home, connection fingerprint, catalog fingerprint, and current-authority checks.
Latest release retains the transport restriction: The same stdio-only catalog guard is present in the supplied latest release, v2026.9.4.
Recovery uses existing ownership fences: Subscription settlement checks the physical client, current binding, host authority, and live ownership handle. Pre-turn retention excludes cancellation and attempted native writes; release uses the generation-bound ownership callback.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Codex plugin connects chat turns to a native Codex App Server. It verifies session ownership and execution policy before reusing a native thread, then returns results and settles its subscription.

flowchart TD
  A[Supervised chat message] --> B[Codex plugin]
  C[Native configuration and login] --> D[Local Codex App Server]
  B --> E[Check ownership and loaded policy]
  E --> D
  D --> F[Turn result or startup failure]
  F --> G[Retain or release subscription]
  G --> B
Loading

Before merge

  • Complete next step (P2) - Add after-fix native startup-failure/retry evidence to the PR body. Terminal output or redacted logs are suitable; screenshots or recordings help when diagnostics are visible. Remove credentials, private endpoints, and account details. Updating the body should trigger review; otherwise ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

PR surface

Source +103, Tests +525, Docs +120. Total +748 across 27 files.

View PR surface stats
Area Files Added Removed Net
Source 12 414 311 +103
Tests 12 1370 845 +525
Docs 3 132 12 +120
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 27 1916 1168 +748

Review metrics

Metric Value Why it matters
Production versus test growth Production +103 net lines; tests and test support +525 net lines Production growth consolidates subscription settlement and adds guarded native reuse; much of the test movement creates focused sibling suites.

Technical review

Best possible solution:

Keep subscription settlement in the existing resource owner while preserving native configuration, recorded search policy, and generation-fenced reuse.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: restoring an established supervised native catalog over Unix transport reaches the explicit rejection on current main. No runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

Yes. Reusing the existing configuration fingerprints and subscription owner is a focused repair, and the branch preserves established policy rather than introducing another configuration path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f5420c9cc61c.

Labels

Label justifications:

  • P2: Repairs a bounded supervised Codex continuation and recovery workflow without evidence of a broad runtime outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted real-client evidence of a recoverable pre-turn failure followed by a successful retry on the same native thread, without an unnecessary unsubscribe or cold resume.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-17T16:47:18.498Z sha 3cdeef9 :: blocked before merge. :: [P1] Preserve old search-policy bindings when capabilities become supported | [P2] Refresh native model metadata before returning a warm binding | [P2] Retain the subscription when refusing an active native thread
  • reviewed 2026-09-17T17:03:17.303Z sha 3cdeef9 :: blocked before merge. :: [P1] Preserve old search-policy bindings when capabilities become supported | [P2] Refresh native model metadata before returning a warm binding | [P2] Retain the subscription when refusing an active native thread
  • reviewed 2026-09-17T19:41:26.688Z sha b62be2d :: needs changes before merge. :: [P3] Describe continuation through the session-viewer composer
  • reviewed 2026-09-17T21:32:04.443Z sha 1089e22 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 17, 2026
@galiniliev

Copy link
Copy Markdown
Contributor Author

Addressed the three findings from this review in b62be2d80022696abc0febd1552e9db094a00190:

  • Existing supervised conversations preserve their recorded disabled native-search policy when the provider starts advertising support.
  • Warm reuse refreshes model/provider metadata from the native thread before persisting and returning attribution, with fallback for older servers that omit it.
  • Active-thread refusal returns the verified subscription to its owner; the regression also proves the following idle retry avoids unsubscribe and cold resume.

Each defect failed its pre-fix regression. All 98 selected behavior tests now pass, including registered harness attribution and lifecycle/cleanup siblings. The implementation preserves the existing replacement and live-authority guards. The native metadata contract was checked directly against Codex thread/read.

The PR body contains the updated validation. Earlier live screenshots remain explicitly tied to their tested commit.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@galiniliev

Copy link
Copy Markdown
Contributor Author

Corrected both setup instructions and the linked branching guide to describe sending from the native session viewer. Also repaired the two CI failures: typed parent-controlled input refusal now preserves retained ownership, and the terminal-overflow test positively verifies intentional native retention. Both failures reproduced before repair; 271 owner-suite tests and current typechecks/lint/guards/docs links pass. Fresh independent review found no actionable P0–P2 findings.

Commit: 1089e22b55673c80faa4d7be94f6e87f48fc9ce9. Native preparation is waiting for this head's CI gate.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Keep valid native subscriptions through passive preflight and pre-turn failures, preserve established search policy when daemon defaults change, and document credential ownership for shared native daemons.

Co-authored-by: steipete <[email protected]>
Co-authored-by: galiniliev <[email protected]>
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Sep 18, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 18, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merge review disposition for 8cefc5caf84b2a32f66a6c4dc6572fc82e92f1c9:

  • The current ClawSweeper review reports no actionable code or security findings. Its remaining request is an additional live startup-failure/retry capture; the same report classifies live proof as not required for this maintainer PR and lists that capture under optional rank-up improvements.
  • The recovery change is covered through the actual attempt startup/cleanup composition with mocked native transport: the injected failure is followed by a retry on the retained thread, with generation, cancellation, revocation, replacement, and closure cases. The fresh five-suite run passed 291 tests, and exact-head hosted CI is green.
  • Codex 0.154.0 subscription ownership was checked directly. This recovery update changes local claim settlement, not the native authentication or RPC contract. The earlier live Unix-daemon proof remains scoped to its original commit.
  • Following the owning PR workflow’s proportional-proof rule, I classify the additional live capture as a nonblocking evidence improvement. It has not been performed and is not being represented as passed; the limitation remains in the PR body. No code finding is being waived, and no automated verdict or required gate is being changed.

Proceeding under the explicit maintainer merge request through the native guarded workflow.

@roboclaw-bot
roboclaw-bot merged commit 3f0b58e into main Sep 18, 2026
110 checks passed
@roboclaw-bot
roboclaw-bot deleted the galiniliev/codex-local-config branch September 18, 2026 02:44
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Merged via squash.

steipete added a commit that referenced this pull request Sep 18, 2026
Restore full-suite ownership for the native-configuration and subscription tests from #151001. Run the inventory guard for app-server test changes while preserving their extension coverage. Completes class #92 alongside the folded #88 and #90 repairs.
steipete added a commit that referenced this pull request Sep 18, 2026
…151349)

#151001 added run-attempt.native-config.test.ts and run-attempt.subscription.test.ts without a shard owner, so test/vitest-projects-config.test.ts (full-suite ownership audit) fails on every merge ref (checks-node-compact-small-39). Register both next to their run-attempt siblings in the extension database-workers shard.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…ns (openclaw#151001)

Preserve native Codex configuration, tools, and model ownership when continuing supervised conversations through a shared local daemon.

Return valid retained subscriptions after passive preflight and pre-turn startup failures without weakening cancellation, revocation, replacement, or ambiguous-write safeguards. Preserve established native search policy when daemon defaults change, and document credential handoff, refresh ownership, and shared-account limits.

Validation: 291 fresh focused tests passed; exact-head hosted CI passed. Additional live startup-failure/retry capture was not performed; the PR records that limitation and the earlier native proof at its original revision.

Co-authored-by: steipete <[email protected]>
Co-authored-by: galiniliev <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…penclaw#151349)

openclaw#151001 added run-attempt.native-config.test.ts and run-attempt.subscription.test.ts without a shard owner, so test/vitest-projects-config.test.ts (full-suite ownership audit) fails on every merge ref (checks-node-compact-small-39). Register both next to their run-attempt siblings in the extension database-workers shard.
steipete added a commit that referenced this pull request Sep 18, 2026
…151339)

Restore filesystem import-boundary, workflow-routing, and full-suite inventory guards after the changes in #151302, #151282, and #151001. Route native filesystem configuration through the existing facade, register the recovery and Codex attempt tests in their existing owners, and select those guards when their inventory inputs change. Includes the reviewed routing repair from #151340 with its original human authorship preserved.

Finalize the existing Gateway serial admission and two-worker ceiling before runtime placement reads recipient policy. This preserves compact worker limits when inventory changes without changing timing measurements, original compaction assertions, configuration, dependencies, or user-facing runtime behavior.

Validation: exact-head CI run 35306657804 completed green; the native watcher exited 0 with no pending checks. Retained focused proof passed 1,591 tests across six files, with both new placement regressions failing before the repair and all four placement cases passing after it. Committed-branch review found no actionable defects. The pre-existing diagnostics test-support lint issue from #151161 remains an explicitly nonblocking follow-up.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…penclaw#151339)

Restore filesystem import-boundary, workflow-routing, and full-suite inventory guards after the changes in openclaw#151302, openclaw#151282, and openclaw#151001. Route native filesystem configuration through the existing facade, register the recovery and Codex attempt tests in their existing owners, and select those guards when their inventory inputs change. Includes the reviewed routing repair from openclaw#151340 with its original human authorship preserved.

Finalize the existing Gateway serial admission and two-worker ceiling before runtime placement reads recipient policy. This preserves compact worker limits when inventory changes without changing timing measurements, original compaction assertions, configuration, dependencies, or user-facing runtime behavior.

Validation: exact-head CI run 35306657804 completed green; the native watcher exited 0 with no pending checks. Retained focused proof passed 1,591 tests across six files, with both new placement regressions failing before the repair and all four placement cases passing after it. Committed-branch review found no actionable defects. The pre-existing diagnostics test-support lint issue from openclaw#151161 remains an explicitly nonblocking follow-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants