feat(codex): supervise native Codex sessions#104045
Conversation
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
# Conflicts: # scripts/plugin-sdk-surface-report.mjs
# Conflicts: # apps/macos/Sources/OpenClaw/TalkMLXSpeechSynthesizer.swift # ui/src/i18n/.i18n/ar.meta.json # ui/src/i18n/.i18n/de.meta.json # ui/src/i18n/.i18n/es.meta.json # ui/src/i18n/.i18n/fa.meta.json # ui/src/i18n/.i18n/fr.meta.json # ui/src/i18n/.i18n/hi.meta.json # ui/src/i18n/.i18n/id.meta.json # ui/src/i18n/.i18n/it.meta.json # ui/src/i18n/.i18n/ja-JP.meta.json # ui/src/i18n/.i18n/ko.meta.json # ui/src/i18n/.i18n/nl.meta.json # ui/src/i18n/.i18n/pl.meta.json # ui/src/i18n/.i18n/pt-BR.meta.json # ui/src/i18n/.i18n/ru.meta.json # ui/src/i18n/.i18n/th.meta.json # ui/src/i18n/.i18n/tr.meta.json # ui/src/i18n/.i18n/uk.meta.json # ui/src/i18n/.i18n/vi.meta.json # ui/src/i18n/.i18n/zh-CN.meta.json # ui/src/i18n/.i18n/zh-TW.meta.json
# Conflicts: # ui/src/i18n/.i18n/ar.meta.json # ui/src/i18n/.i18n/de.meta.json # ui/src/i18n/.i18n/es.meta.json # ui/src/i18n/.i18n/fa.meta.json # ui/src/i18n/.i18n/fr.meta.json # ui/src/i18n/.i18n/hi.meta.json # ui/src/i18n/.i18n/id.meta.json # ui/src/i18n/.i18n/it.meta.json # ui/src/i18n/.i18n/ja-JP.meta.json # ui/src/i18n/.i18n/ko.meta.json # ui/src/i18n/.i18n/nl.meta.json # ui/src/i18n/.i18n/pl.meta.json # ui/src/i18n/.i18n/pt-BR.meta.json # ui/src/i18n/.i18n/ru.meta.json # ui/src/i18n/.i18n/th.meta.json # ui/src/i18n/.i18n/tr.meta.json # ui/src/i18n/.i18n/uk.meta.json # ui/src/i18n/.i18n/vi.meta.json # ui/src/i18n/.i18n/zh-CN.meta.json # ui/src/i18n/.i18n/zh-TW.meta.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3538ca14c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // A missing reserved key must not synthesize work, while unlocked rows are | ||
| // grandfathered user sessions from before the namespace was introduced. | ||
| return ( | ||
| entry?.modelSelectionLocked === true || |
There was a problem hiding this comment.
Keep legacy model locks eligible for Active Memory
When Active Memory is enabled for an ordinary legacy session that has modelSelectionLocked: true but no harness owner, this check returns before recall runs, so those sessions silently lose memory context. The session-store contract still treats those rows as ordinary rather than harness-owned—isValidAgentHarnessSessionStoreEntry requires a reserved harness key or explicit agentHarnessId, and sibling code uses that helper to avoid only real harness locks—so this should distinguish real harness-owned entries from legacy/user model locks instead of skipping every locked entry.
Useful? React with 👍 / 👎.
* feat(codex): add native session supervision * fix(codex): harden supervision integration * fix(codex): preserve locked harness ownership * fix(codex): fence native session archive * fix(codex): revalidate archive binding ownership * feat(codex): integrate supervision runtime * feat(sessions): preserve harness-owned execution * feat(sessions): persist harness ownership invariants * feat(gateway): enforce harness-owned sessions * feat(setup): enable detected Codex supervision * feat(mac): expose supervised Codex sessions * feat(ui): make Codex sessions actionable * docs(codex): document session supervision * test(codex): cover integration ownership * chore(i18n): refresh supervision inventories * fix(setup): finalize Codex activation atomically * test(codex): narrow binding store update * fix(sessions): preserve legacy model locks * test(macos): serialize Codex catalog fixtures * fix(sessions): preserve legacy lock admission * chore(i18n): reconcile supervision metadata * test(sessions): mark legacy lock fixture * fix(macos): drain final Codex catalog frame * docs: leave supervision note to release * style(macos): satisfy Codex catalog type length * chore: record session accessor seam owners * fix(macos): honor configured Codex supervision * fix(codex): preserve harness-owned model locks * fix(codex): satisfy supervision lint gates * chore(i18n): refresh native supervision inventory * fix(codex): align supervision validation contracts * fix(codex): close supervision boundary gaps * fix(codex): preserve supervision activation contracts * fix(codex): dispose standalone supervision runtime * fix(codex): pin supervised source connection * fix(plugins): bind delegated runs to exact session target * fix(codex): scope supervised sessions to configured agents * fix(codex): fingerprint effective supervision home * fix(codex): normalize supervision plugin policy * fix(codex): keep supervised bindings stable across upgrades * fix(codex): guard all supervised binding connections * fix(codex): preserve catalog filters and pending CAS identity * fix(codex): preserve supervision identity for diagnostics * fix(codex): bind uncertain commits to supervision connection * fix(codex): satisfy supervision type boundaries * fix(macos): reconcile current main validation * fix(codex): handle absent runtime config in supervision * fix(doctor): own local audio acceleration check * fix(codex): satisfy integration lint gates * fix(codex): satisfy lifecycle safety guards
Closes #103235
What Problem This Solves
Codex sessions discovered on the local Mac and paired Macs were visible only as a read-only fleet. Users could not open them, continue the work through Codex AppServer, or archive completed local source sessions, and the separate Codex Supervisor plugin duplicated ownership that belongs in the official Codex plugin.
Why This Change Was Made
This folds supervision into the official
codexplugin behindplugins.entries.codex.config.supervision.enabled. The plugin exposes a non-archived, host-federated catalog; creates a model-locked OpenClaw Chat continuation through the Codex AppServer harness; imports bounded visible history into a new Codex branch; and archives eligible local source threads only after fresh status, ownership, and idle checks.The phase-one safety boundary is deliberate: paired-node catalogs are read-only, local continuation snapshot-forks instead of taking over the exact source thread, and local source archive requires explicit confirmation that no other runner owns it. Exact cross-process takeover and remote continue/archive need a duplex runner plus an explicit lease protocol and are not claimed here.
User Impact
Users who install the Codex and OpenClaw Mac apps can enable Codex supervision and see active native Codex sessions in OpenClaw. Eligible local stored or idle sessions can be continued in Chat without selecting another model; all subsequent turns stay on the Codex AppServer runtime. Eligible local sources can be archived from the same view, while offline hosts and remote sessions remain visible without exposing transcript content.
Guided setup now detects a native Codex installation independently of the primary OpenClaw model and enables this capability when policy permits. Documentation covers configuration, behavior, security boundaries, troubleshooting, and current limitations.
Evidence
pnpm test extensions/codex src/agents/embedded-agent-runner/run/setup.test.ts src/config/sessions/store.agent-harness-invariant.test.ts src/sessions/agent-harness-session-key.test.ts src/gateway/server-methods/agent.test.ts— 2,852 tests passed across five Vitest shards on Blacksmith Testbox.pnpm --dir ui test— 3,159 tests passed across 203 files on Blacksmith Testbox.pnpm test:ui:e2e -- ui/src/e2e/codex-sessions.e2e.test.ts— browser scenario passed: search, pagination, continuation, archive, and offline-host preservation.pnpm tsgo:all— passed on Blacksmith Testbox.swift test --package-path apps/macos --parallel— 969 tests across 127 suites passed locally; focused post-rebase native catalog suite: 22 tests passed.node --import tsx scripts/control-ui-i18n.ts check,node --import tsx scripts/native-app-i18n.ts check, andnode scripts/generate-npm-shrinkwrap.mjs --check --all— clean.codex-rs/app-server-protocol/src/protocol/v2/thread.rs,codex-rs/app-server/src/request_processors/thread_processor.rs, andcodex-rs/app-server/src/thread_status.rsat Codex22781d40019779abc158723f2387cc6bce22a7ce.