Repository navigation
fix(codex): resume catalog sessions with the catalog's CODEX_HOME; add main-content terminal placement - #120708
Merged
Merged
Conversation
The Codex session catalog lists threads through the plugin's supervision app-server connection, which can run on the agent-scoped Codex home (homeScope: "agent"). The terminal resume plan spawned a bare 'codex resume <threadId>' under the operator login shell, so the CLI resolved its default ~/.codex and failed with "No saved session found". Terminal plans now carry the catalog connection's CODEX_HOME (local and paired-node paths), the gateway merges plan env into the PTY spawn, and the triplicated home-scope resolution collapses into one shared resolveCodexAppServerLocalHomeDir.
The terminal panel gains a third dock placement, "main", filling the content region next to the sidebar like the transcript pane. The panel header gets a bottom/right/main placement switcher (persisted in the existing openclaw.terminal.panel.v1 store), and opening a Codex/Claude session from the session catalog selects main mode so resumed sessions appear as a full window instead of a bottom strip.
steipete
marked this pull request as ready for review
August 8, 2026 21:15
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 9, 2026
…d main-content terminal placement (openclaw#120708) * fix(codex): pin catalog CODEX_HOME onto terminal resume spawns The Codex session catalog lists threads through the plugin's supervision app-server connection, which can run on the agent-scoped Codex home (homeScope: "agent"). The terminal resume plan spawned a bare 'codex resume <threadId>' under the operator login shell, so the CLI resolved its default ~/.codex and failed with "No saved session found". Terminal plans now carry the catalog connection's CODEX_HOME (local and paired-node paths), the gateway merges plan env into the PTY spawn, and the triplicated home-scope resolution collapses into one shared resolveCodexAppServerLocalHomeDir. * feat(ui): add main-content terminal placement The terminal panel gains a third dock placement, "main", filling the content region next to the sidebar like the transcript pane. The panel header gets a bottom/right/main placement switcher (persisted in the existing openclaw.terminal.panel.v1 store), and opening a Codex/Claude session from the session catalog selects main mode so resumed sessions appear as a full window instead of a bottom strip.
This was referenced Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Opening a Codex session from the Control UI session catalog into a terminal failed with:
Additionally, the terminal only rendered as a bottom/right dock strip; a resumed session could not occupy the main content area like the transcript viewer does.
Why This Change Was Made
Bug root cause: the Codex session catalog lists threads through the plugin's supervision app-server connection, which can run on the agent-scoped Codex home (
plugins.entries.codex.config.appServer.homeScope: "agent"→<agentDir>/codex-home). Verified on a live gateway: the failing thread existed in the agent home'sstate_5.sqliteand sessions tree, not in~/.codex. The terminal plan spawned a barecodex resume <threadId>under the operator login shell env, so the CLI resolved its default~/.codex(codex-rs/utils/home-dir) and correctly reported no such session. The catalog knew whichCODEX_HOMEit listed from and discarded that fact before the spawn — an env ownership gap on both the gateway-local and paired-node PTY paths.Fix shape: record the fact where it is produced.
SessionCatalogTerminalPlan(local variant) gains a boundedenvmap;openCodexCatalogTerminalresolves the supervision connection's home and pinsCODEX_HOMEon local and node resume plans; the gateway merges plan env into the PTY spawn;runNodePtyCommandaccepts env overrides. The home-scope resolution that existed in three copies (auth-bridge startup, cache-key identity, and now the terminal) is consolidated into one sharedresolveCodexAppServerLocalHomeDir, so the terminal cannot drift from what the app-server actually used.Main-pane terminal: the dock system gains a third placement
"main"alongside bottom/right — the panel fills the content region next to the sidebar (no resize divider; routed content stays mounted underneath). A three-way placement switcher in the panel header persists through the existingopenclaw.terminal.panel.v1store. Opening a session from the catalog selects main mode so a resumed session comes up as a full window. Named tradeoff (commented): main mode ignores sibling dock reservations; a right-docked browser/custodian panel overlays rather than shrinks it.User Impact
~/.codexsetups keep working unchanged —startOptions.env.CODEX_HOMEstill wins when set).Evidence
Focused suites (via
node scripts/run-vitest.mjs), all green:extensions/codex/src/session-catalog.test.ts— 99 passed (new: agent-home vs user-home plan env, node PTYCODEX_HOMEinjection)src/gateway/server-methods/terminal.test.ts— 24 passed (spawn env contains planCODEX_HOMEand preservespathEnvPATH)src/node-host/pty-command.test.ts— 3 passed (env override precedence, TERM/OPENCLAW_TERMINAL markers)ui/src/components/{dock-panel-layout,terminal/terminal-panel,terminal/terminal-panel-suppression,terminal/terminal-panel-accessibility}.test.ts— 37 passed (main-mode persistence round-trip, no resizer in main mode, catalog-open forcing main, settings-takeover suppression, switcher a11y labels)Gates:
pnpm plugin-sdk:surface:checkgreen, i18n baseline green,git diff --checkclean, changed-files check gate green (remote routing unavailable; documented trusted-source local fallback used). Codex autoreview (gpt-5.6-sol, high): clean, no accepted/actionable findings.Dependency proof:
codex resumeid lookup path read directly in sibling../codexcheckout —codex-rs/tui/src/lib.rs(lookup_session_target_with_app_server→thread/read),codex-rs/app-server/src/request_processors/thread_processor.rs(read_thread_view),codex-rs/thread-store/src/local/read_thread.rs(resolve_rollout_pathscoped toconfig.codex_home) — confirming resume resolution is strictly CODEX_HOME-scoped.Production LOC: +93 net (new placement + env ownership boundary; resolver consolidation nets negative inside the codex plugin). Tests: +141.