Skip to content

fix(codex): preserve user home default for session catalog - #116131

Merged
steipete merged 6 commits into
openclaw:mainfrom
IWhatsskill:fix/codex-catalog-user-home-default
Jul 31, 2026
Merged

steipete merged 6 commits into
openclaw:mainfrom
IWhatsskill:fix/codex-catalog-user-home-default

Conversation

@IWhatsskill

@IWhatsskill IWhatsskill commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

[AI-assisted]

What Problem This Solves

When a Codex app-server block omitted homeScope, schema validation inserted agent before the session catalog saw the configuration. The native Codex catalog therefore opened the agent store instead of the user's intact CLI session store.

Failure mode

The supervision resolver already has connection-aware local fallbacks, but it cannot distinguish omission from an explicitly authored agent value after schema default hydration.

Why This Change Was Made

The manifest no longer assigns a homeScope default. The runtime owner that knows whether the connection is an ordinary harness, local supervision, or websocket supervision now applies the existing safe fallback while explicit settings remain authoritative.

Root Cause

Core plugin validation applies JSON-schema defaults during startup and live reload. The manifest's nested agent default erased authorship information before createCodexSessionCatalogControl called resolveCodexSupervisionAppServerRuntimeOptions.

Runtime ownership

Ordinary harness connections continue to default to agent, local stdio and Unix supervision default to user, websocket supervision defaults to agent, and explicit homeScope values continue to win.

Current source contract

OpenClaw main 36b80ada3ceae2de21b3d8710b883d778e4c4578 is the rebased review baseline. Direct caller inspection confirms ordinary conversation, command, binding, and migration paths use the harness resolver, while session-catalog and native control connections use the supervision resolver. Sibling Codex source 775fb21d2af9b9936618fe22dd62e6f0cb3ba4a3 confirms app-server resolves CODEX_HOME as its process-scoped store root and thread/list reads through that configured store.

User Impact

The native Codex session catalog can see the user's CLI sessions by default even when other app-server settings are present. Omitted local Unix supervision also reaches its required user scope instead of being rejected after schema hydration. Agent harness isolation, explicit scope choices, and websocket safety remain unchanged.

Evidence

At rebased head 9d8368b8721c65d341be396fbd5b60116f9b1032, four focused suites and 280 tests passed. A new real command-RPC regression also proves omitted Unix supervision reaches its explicit user-scoped connection without being rejected by the ordinary harness resolver. Historical real-Gateway evidence from the original reviewed head b835daee8167186c2036967458614cc47e67db6a remains below.

Inspect historical Gateway proof and current-head verification

Provenance

  • Current review base: 36b80ada3ceae2de21b3d8710b883d778e4c4578
  • Current reviewed head: 9d8368b8721c65d341be396fbd5b60116f9b1032
  • Historical Gateway proof base: 68c472f379ad2fd97e586254f51088ecbd6ac6d7
  • Historical Gateway proof head: b835daee8167186c2036967458614cc47e67db6a

Direct behavior

Historical Gateway Codex session catalog proof

The disposable credentialed proof script was removed before landing; its already-recorded, redacted production Gateway result is retained below.

  • Gateway Codex session catalog (PRODUCTION_RUNTIME; boundary: real OpenClaw Gateway registration and sessions.catalog.list RPC through manifest normalization, live reload, session catalog, supervision resolution, shared client startup, and Codex 0.146.0 app-server) — Observed: the initial catalog returned the first user-home thread and excluded the agent-home sentinel; a newly materialized user thread remained absent from the old cached page, then appeared after the accepted reload while the agent sentinel remained absent. Result: the native Codex session catalog replaced its stale page with a user-store result after real Gateway live configuration replacement. Proves omitted scope survives schema normalization and reaches the user-scoped local stdio catalog fallback across startup and a discriminating reload transition. Preserves user-store selection and agent-store exclusion on the exercised omitted local-stdio catalog path.

Redacted historical Gateway output

{
  "exact_head": "b835daee8167186c2036967458614cc47e67db6a",
  "test_runner": "none",
  "gateway_registration": "real",
  "plugin_schema_validation": "real",
  "config_reload": "accepted",
  "catalog_rpc": "sessions.catalog.list",
  "user_sentinel_fingerprint": "bd5a57583b47baa6",
  "reload_user_sentinel_fingerprint": "e256f067ce6d5669",
  "agent_sentinel_fingerprint": "086908b88361dfd3",
  "initial_user_sentinel_visible": true,
  "initial_agent_sentinel_visible": false,
  "pre_reload_cached_new_user_sentinel_visible": false,
  "reloaded_user_sentinel_visible": true,
  "reloaded_new_user_sentinel_visible": true,
  "reloaded_agent_sentinel_visible": false,
  "verdict": "PASS"
}

Automated verification

Codex catalog and runtime contract

node scripts/run-vitest.mjs extensions/codex/src/command-rpc.test.ts extensions/codex/src/session-catalog.test.ts extensions/codex/src/app-server/config.test.ts extensions/codex/src/supervision-tools.test.ts
  • Four test files and 280 tests passed with 0 failures on a Blacksmith Testbox at the current rebased head. The catalog regression validates the actual plugin manifest before a catalog request. The command-RPC regression reproduces the formerly hidden omitted-Unix failure and proves configured timeout plus native-auth boundaries remain intact. Existing runtime/supervision suites preserve ordinary harness isolation, explicit scope choices, and websocket safety.

Preserved boundaries

  • Ordinary Codex agent harnesses keep the agent-scoped default.
  • Explicitly authored homeScope values remain authoritative.
  • Websocket supervision keeps the safe agent-scoped default.
  • Omitted local Unix supervision now receives the resolver's required user scope instead of the manifest's accidental agent value.
  • No session contents, authentication data, command selection, or storage layout are changed.

Proof gap

A remote websocket connection and UI presentation were not run. The historical production proof covers local stdio, and the current-head regression crosses the real Unix command-RPC boundary. The credentialed Gateway/provider turn was intentionally not repeated after rebasing because its redacted successful result remains available and the disposable one-off proof script was removed.

Artifacts

  • Current-source inspection is bound to OpenClaw main 36b80ada3ceae2de21b3d8710b883d778e4c4578 and sibling Codex 775fb21d2af9b9936618fe22dd62e6f0cb3ba4a3.
  • The disposable 542-line proof script and its lint failures were removed; the historical redacted Gateway result remains above.
  • The current-head Unix regression closes a real transport gap that the original mocked catalog test could not detect.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 2:43 PM ET / 18:43 UTC.

ClawSweeper review

What this changes

The branch removes the Codex plugin manifest’s appServer.homeScope: agent default and makes explicit supervised control connections use the supervision runtime resolver.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 5 items remain

This PR remains open for manual review rather than receiving a Codex correctness or merge verdict. Current main confirms the reported default mismatch is plausible, but the required sibling ../codex source checkout is absent and the attempted GitHub fetch failed because github.com DNS could not resolve. Likely related people: steipete for the latest resolver correction and assigned review, and Vincent Koc for the current-main provenance boundary (low confidence).

Priority: P2
Reviewed head: 9d8368b8721c65d341be396fbd5b60116f9b1032
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR presents strong claimed runtime evidence and a focused compatibility repair, but its final quality cannot be rated higher until the required Codex dependency contract and exact branch tree are directly reviewed.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The PR body provides substantial redacted Gateway and Unix control-RPC evidence, but repository policy requires direct sibling-Codex source inspection before this reviewer can call Codex runtime proof sufficient; restore that checkout or document a maintainer waiver before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR body provides substantial redacted Gateway and Unix control-RPC evidence, but repository policy requires direct sibling-Codex source inspection before this reviewer can call Codex runtime proof sufficient; restore that checkout or document a maintainer waiver before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main mismatch: The manifest currently hydrates omitted appServer.homeScope to agent, while the supervision resolver independently defaults omitted non-WebSocket supervision connections to user; schema hydration can therefore erase omission before the owner-specific resolver receives it.
Catalog uses the supervision owner: The catalog creates supervised runtime options and passes its prepared start options through codexControlRequest, so the diff targets the boundary between catalog-owned options and the generic control-RPC helper.
Current tests establish intended split: Current-main tests specify agent for ordinary app-server runtime defaults and user only for supervision control connections, including session-catalog request assertions.
Findings None None.
Security None None.

How this fits together

The bundled Codex plugin resolves app-server startup options for two connection owners: ordinary agent harnesses and passive supervision/catalog controls. The chosen home scope determines which Codex store the app-server reads, so it affects whether native catalog and control RPCs see agent-local or user CLI sessions.

flowchart LR
  A[Plugin manifest config] --> B[Schema default hydration]
  B --> C[App-server runtime resolver]
  C --> D{Connection owner}
  D -->|Agent harness| E[Agent-scoped Codex store]
  D -->|Supervision or catalog| F[User-scoped local Codex store]
  E --> G[Codex app-server RPC]
  F --> G
Loading

Decision needed

Question Recommendation
Should this compatibility-sensitive Codex default change wait for the required direct sibling-Codex contract inspection, or should a maintainer explicitly waive that repository review gate for this already-assigned PR? Restore the Codex contract check: Provide or restore the sibling ../codex checkout and refresh this PR review against the exact current head before merge.

Why: The repository’s Codex policy forbids a correctness, merge, or proof-sufficiency verdict without personally inspecting ../codex, which is unavailable in this read-only environment.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR body provides substantial redacted Gateway and Unix control-RPC evidence, but repository policy requires direct sibling-Codex source inspection before this reviewer can call Codex runtime proof sufficient; restore that checkout or document a maintainer waiver before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The branch removes a schema default that existing omitted configurations currently receive, so merge safety depends on verifying every affected caller retains harness isolation while local supervision receives the intended user scope.
  • Resolve merge risk (P1) - OpenClaw policy requires direct sibling Codex source inspection before a Codex merge or proof-sufficiency verdict; the required checkout is absent and network resolution prevented obtaining it.
  • Resolve merge risk (P1) - The exact branch tree could not be fully read from the promisor checkout after DNS failure, so the supplied diff and PR body cannot substitute for a complete current-head dependency review.
Agent review details

Security

None.

PR surface

Source +3, Tests +59. Total +62 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 6 3 +3
Tests 2 60 1 +59
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 66 4 +62

Review metrics

Metric Value Why it matters
Config-default surface 1 default removed Removing the manifest default changes how every existing configuration that omits appServer.homeScope reaches the owner-specific resolver.

Stored data model

Persistent data-model change detected: persistent cache schema: extensions/codex/src/session-catalog.test.ts, serialized state: extensions/codex/src/session-catalog.test.ts, unknown-data-model-change: extensions/codex/src/session-catalog.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify the exact Codex contract before merge (recommended)
    Restore the sibling Codex source and confirm that its app-server store selection and thread-list behavior match the proposed home-scope routing.
  2. Accept a documented gate waiver
    A maintainer can accept the compatibility risk based on the supplied redacted Gateway proof, but should explicitly own the unavailable dependency-source check.
  3. Pause until review infrastructure is available
    Keep this small PR open without further branch churn until the required Codex source and exact-head review can be completed.

Technical review

Best possible solution:

Restore read-only access to the sibling Codex checkout, then review the exact head’s app-server CODEX_HOME and thread/list contract alongside all explicit startOptions callers; merge only if the owner split remains agent for harnesses, user for local supervision, and agent for WebSocket supervision.

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

No high-confidence live reproduction was established in this read-only review. Current source does show the conflicting manifest and supervision defaults, and the PR body supplies redacted runtime evidence, but the required sibling Codex runtime contract could not be inspected.

Is this the best way to solve the issue?

Unclear. Moving an omission-sensitive default to the connection owner matches the current OpenClaw resolver design, but the exact PR head and Codex app-server contract must be inspected before confirming this is the best safe fix.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 36b80ada3cea.

Labels

Label justifications:

  • P2: The change addresses a bounded but user-visible Codex session-catalog compatibility defect.
  • merge-risk: 🚨 compatibility: An existing schema default is removed, so omitted configuration can resolve differently during upgrade or live reload.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body provides substantial redacted Gateway and Unix control-RPC evidence, but repository policy requires direct sibling-Codex source inspection before this reviewer can call Codex runtime proof sufficient; restore that checkout or document a maintainer waiver before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main mismatch: The manifest currently hydrates omitted appServer.homeScope to agent, while the supervision resolver independently defaults omitted non-WebSocket supervision connections to user; schema hydration can therefore erase omission before the owner-specific resolver receives it. (extensions/codex/openclaw.plugin.json:237, 36b80ada3cea)
  • Catalog uses the supervision owner: The catalog creates supervised runtime options and passes its prepared start options through codexControlRequest, so the diff targets the boundary between catalog-owned options and the generic control-RPC helper. (extensions/codex/src/session-catalog.ts:296, 36b80ada3cea)
  • Current tests establish intended split: Current-main tests specify agent for ordinary app-server runtime defaults and user only for supervision control connections, including session-catalog request assertions. (extensions/codex/src/app-server/config.test.ts:759, 36b80ada3cea)
  • Feature provenance: git blame attributes the current manifest default, generic control resolver call, and supervision resolver to the current-main ancestry headed by commit 3d2dbec9cebfc9693a4a4063fd36bb6234a6b420; that commit is an ancestor of current main, but the shallow/promisor history did not provide a narrower feature-origin commit locally. (extensions/codex/src/command-rpc.ts:74, 3d2dbec9cebf)
  • Required Codex dependency contract unavailable: Repository policy requires direct inspection of sibling ../codex before a Codex verdict or proof-sufficiency claim. The sibling checkout does not exist, and the attempted promisor fetch for branch/history data failed because github.com could not be resolved.
  • Release and main status: The requested behavior is not implemented on current main: the manifest still has the agent default. Therefore there is no fixed release or current-main fix provenance for a close decision. (extensions/codex/openclaw.plugin.json:240, 36b80ada3cea)

Likely related people:

  • steipete: The supplied PR context shows the current head’s final resolver correction was authored by steipete, and the timeline records assignment to steipete on July 31, 2026. (role: recent resolver contributor and assigned reviewer; confidence: high; commits: 9d8368b8721c; files: extensions/codex/src/command-rpc.ts)
  • Vincent Koc: Local blame assigns the relevant current-main manifest, resolver, and generic control-helper lines to ancestry at commit 3d2dbec9cebfc9693a4a4063fd36bb6234a6b420, though the available partial history does not establish focused feature ownership. (role: current-main provenance boundary; confidence: low; commits: 3d2dbec9cebf; files: extensions/codex/openclaw.plugin.json, extensions/codex/src/command-rpc.ts, extensions/codex/src/app-server/config-runtime.ts)

Rank-up moves

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

  • Restore or provide read-only access to the sibling ../codex checkout and inspect the relevant app-server store and thread/list implementation.
  • Refresh the exact-head resolver and caller review after the dependency contract is available.

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 (2 earlier review cycles)
  • reviewed 2026-07-29T23:58:51.451Z sha 9cabaa7e5d5da6d215acf4b57193c3fe7759aa4f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T00:23:09.297Z sha b835daee8167186c2036967458614cc47e67db6a :: needs maintainer review before merge. :: none

@IWhatsskill
IWhatsskill marked this pull request as ready for review July 30, 2026 00:14
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 30, 2026
@steipete steipete self-assigned this Jul 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed scripts Repository scripts size: L labels Jul 31, 2026
@steipete
steipete force-pushed the fix/codex-catalog-user-home-default branch from 5a07abe to 9d8368b Compare July 31, 2026 18:20
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Jul 31, 2026
@steipete

Copy link
Copy Markdown
Contributor

Maintainer landing review and proof at head 9d8368b8721c65d341be396fbd5b60116f9b1032:

  • Preserves omitted appServer.homeScope through actual plugin-manifest normalization, so local Codex supervision selects the user store while ordinary harness resolution remains agent-scoped.
  • Fixes the independently reproduced Unix control-RPC failure where an explicit supervised start was rejected by the ordinary agent-harness resolver before its user-scoped start options could be applied.
  • Removed the 542-line one-off Gateway proof script and folded the manifest regression into existing catalog coverage; final patch is four files, +66/-4.
  • Inspected the Codex upstream contracts directly: ../codex/codex-rs/utils/home-dir/src/lib.rs:13, ../codex/codex-rs/app-server/src/message_processor.rs:243, ../codex/codex-rs/thread-store/src/local/mod.rs:167, and ../codex/codex-rs/thread-store/src/local/list_threads.rs:50.
  • Exact-head Blacksmith Testbox lease tbx_01kywpmnrmqn6j1w0z7yt4cr13 passed 280 tests across four files, targeted lint, and the full changed-file production/test typecheck, extension lint, boundaries, formatting, metadata, deadcode, and import-cycle gates:
    pnpm test extensions/codex/src/command-rpc.test.ts extensions/codex/src/session-catalog.test.ts extensions/codex/src/app-server/config.test.ts extensions/codex/src/supervision-tools.test.ts
    node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/codex/src/command-rpc.ts extensions/codex/src/command-rpc.test.ts extensions/codex/src/session-catalog.test.ts
    pnpm check:changed
    .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
  • Fresh structured Codex autoreview was clean: no accepted/actionable findings; patch correctness confidence 0.98.
  • Known proof gap: the contributor's successful real-Gateway user-store sentinel/reload transcript was produced at historical head b835daee8167186c2036967458614cc47e67db6a; a fresh credentialed live-provider turn was not rerun. Exact-head owner-boundary and Unix regressions, direct upstream contract inspection, and the full Blacksmith gate cover the revised implementation.
  • GitHub CI run 30654760775 is being retried because two fork-only GitHub-hosted lint runners received an external shutdown signal; the same lint/typecheck gates passed independently on Blacksmith, and neighboring forks have since passed the identical hosted lane.

@steipete
steipete merged commit 38d53e3 into openclaw:main Jul 31, 2026
254 of 266 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
…116131)

* fix-codex-preserve-user-home-session-catalog-default

* fix-codex-cover-catalog-reload-proof

* fix-codex-harden-catalog-home-proof

* fix-codex-enforce-proof-cleanup

* test(codex): require proof process shutdown

* fix(codex): honor supervised Unix control connections

---------

Co-authored-by: IWhatsskill <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants