Skip to content

fix(codex): preserve apps in managed remote startup#310

Open
danshapiro wants to merge 7 commits intocodex/fix-codex-appserver-boot-stall-basefrom
codex/fix-codex-appserver-boot-stall
Open

fix(codex): preserve apps in managed remote startup#310
danshapiro wants to merge 7 commits intocodex/fix-codex-appserver-boot-stall-basefrom
codex/fix-codex-appserver-boot-stall

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

@danshapiro danshapiro commented Apr 24, 2026

Summary

  • preserve codex --remote, codex_apps, and Freshell MCP instead of disabling Apps
  • pass the same Freshell MCP -c mcp_servers.freshell... config and FRESHELL_* environment into the managed codex app-server sidecar, which is the process that actually boots codex_apps
  • preallocate Codex terminal IDs so the visible TUI, managed app-server, registry record, and Freshell MCP target all agree on one terminal identity
  • keep Codex launch validation ahead of layout mutation for /api/tabs and /api/run
  • retain the prior startup-probe/session-identity fixes and remove the temporary features.apps=false workaround

Root cause

  • Freshell passed Freshell MCP config only to the visible codex --remote TUI process
  • codex --remote did not forward that local config to the external codex app-server; traced thread/start showed config: null
  • the TUI waited for MCP server readiness based on local expectations, while the app-server only booted its own servers, leaving the header stuck on Booting MCP server: codex_apps

Validation

  • npm run test:server -- --run test/unit/server/coding-cli/codex-app-server/launch-planner.test.ts test/integration/server/codex-session-flow.test.ts
  • npm run test:server -- --run test/server/agent-panes-write.test.ts test/server/agent-run.test.ts test/server/agent-tabs-write.test.ts test/server/ws-protocol.test.ts test/server/ws-terminal-create-reuse-running-codex.test.ts
  • FRESHELL_TEST_SUMMARY='codex app-server no-loss startup fix before local main landing' npm test
  • real local smoke with proxy tracing: managed app-server reports both freshell and codex_apps MCP readiness, and the Codex prompt appears without disabling Apps

Copy link
Copy Markdown

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

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: 3d214162d3

ℹ️ 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".

session,
paneContent: paneContentRef.current,
currentTab,
currentTab: tabHasSinglePane ? currentTab : undefined,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid unconditional flush for split agent-chat panes

When tabHasSinglePane is false, this passes undefined as currentTab into buildAgentChatPersistedIdentityUpdate, but that helper still treats the missing tab session as a mismatch and sets shouldFlush to true. In split tabs, any subsequent session updates can therefore keep dispatching flushPersistedLayoutNow() even when neither pane nor tab identity actually changed, causing unnecessary immediate persistence work and write churn.

Useful? React with 👍 / 👎.

@danshapiro danshapiro changed the title fix(agent-chat): stabilize split-pane durable restore identity fix(codex): stabilize startup and restored session identity Apr 25, 2026
@danshapiro danshapiro changed the title fix(codex): stabilize startup and restored session identity fix(codex): preserve apps in managed remote startup Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant