Skip to content

feat: add persistent governed Codex coworker - #319

Closed
FsDevNinja wants to merge 3 commits into
CopilotKit:mainfrom
FsDevNinja:codex-subscription-spike
Closed

feat: add persistent governed Codex coworker#319
FsDevNinja wants to merge 3 commits into
CopilotKit:mainfrom
FsDevNinja:codex-subscription-spike

Conversation

@FsDevNinja

Copy link
Copy Markdown

Summary

  • add a host-side AG-UI adapter that uses the locally authenticated Codex app-server and ChatGPT subscription
  • persist the OpenBot-thread to Codex-thread join atomically, resume the exact Codex thread after adapter/app-server restarts, and refuse corrupt recovery state instead of silently starting over
  • expose only OpenBot deployment-owned tools as Codex dynamic tools, then execute every call through the existing signed /api/agent-tools/call grant, policy, and audit boundary
  • disable Codex MCP, app, plugin, web, hook, memory, and multi-agent capabilities; run turns read-only without network and interrupt native action attempts
  • reject stale, malformed, unexpected, and duplicate callbacks; cancel the Codex turn and gateway request when OpenBot ends the run
  • install the host adapter from the root workspace and document/configure the local Codex mode

Verification

  • bun run lint
  • bun run format:check
  • bun run typecheck
  • bun run build
  • bash -n scripts/start.sh
  • bun test --coverage agent-codex/tests tests/workspace.test.ts — Codex source: 98.91% lines overall, 97.68% in the app-server client
  • real installed Codex app-server: dynamic callback completed through the adapter
  • real installed Codex app-server: a second app-server process resumed the same thread ID and recalled the prior turn

The full local suite reached 2,155 pass / 23 skip. Five existing tests outside this diff failed locally: two agent-bot startup tests cannot resolve that non-workspace package's local @ag-ui/encoder, and three existing handoff integration cases failed against the shared test database. This PR changes no server or handoff source/test files.

Notes

Codex dynamic tools are currently an experimental app-server capability. The adapter enables that protocol explicitly and fails closed when it cannot establish the required ChatGPT account, recovery state, or OpenBot callback credentials.

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