Skip to content

feat(codex): supervise native Codex sessions#104045

Merged
steipete merged 61 commits into
mainfrom
codex/codex-supervision
Jul 11, 2026
Merged

feat(codex): supervise native Codex sessions#104045
steipete merged 61 commits into
mainfrom
codex/codex-supervision

Conversation

@steipete

@steipete steipete commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

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 codex plugin behind plugins.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, and node scripts/generate-npm-shrinkwrap.mjs --check --all — clean.
  • Direct Codex contract inspection: codex-rs/app-server-protocol/src/protocol/v2/thread.rs, codex-rs/app-server/src/request_processors/thread_processor.rs, and codex-rs/app-server/src/thread_status.rs at Codex 22781d40019779abc158723f2387cc6bce22a7ce.

@steipete
steipete requested a review from a team as a code owner July 11, 2026 01:35
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/codex-supervisor/package.json
  • pnpm-lock.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: e3538ca14cc58517ba9032001cd382a1a501a231
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord and removed dependencies-changed PR changes dependency-related files labels Jul 11, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 11, 2026
steipete added 2 commits July 11, 2026 00:10
# 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
@steipete
steipete merged commit f94a7dc into main Jul 11, 2026
6 checks passed
@steipete
steipete deleted the codex/codex-supervision branch July 11, 2026 07:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: macos App: macos app: web-ui App: web-ui channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call commands Command implementations dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: codex extensions: codex-supervisor Extension: codex-supervisor gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts security Security documentation size: XL 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.

Make Codex supervision interactive and owned by the Codex plugin

1 participant