Skip to content

feat: connect threads to existing local Codex conversations - #1

Draft
guylfe wants to merge 2 commits into
pr-base/codex-native-bridge-30b62aafrom
feat/codex-existing-conversation-bridge
Draft

guylfe wants to merge 2 commits into
pr-base/codex-native-bridge-30b62aafrom
feat/codex-existing-conversation-bridge

Conversation

@guylfe

@guylfe guylfe commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Review draft on the contributor fork. Intended upstream: milind-soni/OpenMausBot. The GitHub integration returned 403 Resource not accessible by integration when creating the upstream PR, and the connected browser is signed out. This base branch is pinned to the tested upstream commit so this PR contains only the feature's 31 files. An authenticated upstream submission remains outstanding.

What changed

Adds an owner-only local Codex connection to an OpenMausBot thread. Messages go to the selected existing native conversation and its actual replies/images return with conversation/turn/item provenance. A failed or disconnected reservation cannot fall back to the OpenMausBot bot.

  • Select, inspect, reconnect, and disconnect through thread controls and authenticated HTTP routes; persist reservations and delivery receipts.
  • Read and resume the exact native ID without model, effort, cwd, sandbox, approval, instruction, or tool overrides. Never call thread/start, thread/fork, unarchive, or transcript-recovery paths.
  • Require Codex 0.163.x plus a verifiable thread-owned saved permission snapshot before resume. Recheck account/store and effective settings on reconnect.
  • Persist a FIFO outbox before dispatch; reconcile native client-message IDs and deduplicate replies from durable messages. Uncertain dispatch is held for explicit review rather than replayed.
  • Use existing approval/question cards. Do not synthesize session grants, remembered commands, root grants, extra permission payloads, or unsupported native interfaces.
  • Forward admitted images, preserve supported document references under native permissions, and import native images/documents through the existing attachment store. Report inaccessible files explicitly.

Setup, disconnection, HTTP contracts, limitations, a no-account UI fixture, and a separately authorized text/existing-image smoke test are in the guide. No personal target IDs are committed.

Why

An existing Codex conversation should remain the source of history, settings, permissions, and responses when an OpenMausBot thread serves as its interface. The normal Codex driver deliberately injects OpenMausBot instructions/settings and can rebuild a missing session, so this uses a separate native path.

Draft / compatibility boundary: this implements local Codex app-server conversations. It does not expose or invent a binding API for a cloud-only ChatGPT/Codex Work conversation. A UUID/title alone cannot make that conversation accessible. Codex 0.159.2 is refused because its legacy permission restoration differs. Real-account native resumption and the intended live target remain unverified.

How it was verified

Linux, Node 24, isolated disposable homes and fake engines only:

  • New feature coverage: 30 tests across durable bindings, stdio transport, permission-snapshot validation, admin-scoped routes, and a real isolated-server end-to-end fixture.
  • Combined relevant run: 174 passed across 14 files, including the new tests, message routes, request auth, images, approval/question components, and source/route ratchets. Final staged-head end-to-end and ratchets: 3 passed. Approval-scope hardening: 20 passed, followed by the strengthened scope test file 19 passed.
  • NODE_OPTIONS=--max-old-space-size=4096 pnpm typecheck, pnpm lint, pnpm i18n:check, pnpm exec vite build, and pnpm build:server passed. Client build retains the existing CSS-highlight and large-chunk warnings.
  • Broader Codex-driver run: 247 passed, 1 skipped, 1 timeout. The timed-out config.toml test passed its isolated rerun. The skipped proxy-settings test fails identically on unchanged base 30b62aaf18adc22099c24a7181abf5e9ddead980; it was also run directly on this branch and is still failing.
  • Full pnpm test was not completed; no full-suite or native Windows/macOS claim.
  • Real ChatView/Composer browser fixture: native reply rendered, an existing native image decoded inline, provenance expanded, 390px connection panel fit without internal overflow, and canonical disconnect confirmation/Escape worked; no page errors. The full app has the same pre-existing document overflow before and after binding at that viewport. Scoped UI static audit and DESIGN lint passed; a repo-wide static audit was stopped without a result.
  • Installed protocol verification: generated schemas inspected from bundled 0.159.2 and separately installed disposable 0.163.0, checked against official app-server docs and pinned upstream resume source. A no-inference 0.163.0 probe initialized; creating a disposable native fixture thread timed out. No model turn was sent to either real binary. This is not live-account verification.

No running user app was restarted, no live binding/account/conversation was changed, no model/image usage was incurred, and nothing was deployed or merged.

Remaining verification owner: a maintainer/operator with an authorized local 0.163.x account/store can run the guide's manual smoke. If the desired conversation exists only in Work, its service owner must first expose a supported exact-conversation transport.

Tested upstream base: 30b62aaf18adc22099c24a7181abf5e9ddead980.
Head: 048737e682a3473aafe8f0fc9edb441bdf4f1875; tree a946964f93c485ab7a18fed42c8460790de05ea7. Uploaded blobs were checked against the local staged Git hashes and the resulting tree matches exactly.

Screenshots (UI changes)

Synthetic fixture data only.

Before:

Disconnected

After:

Connected with native image and reply

Narrow connection panel

Checklist

  • pnpm typecheck and pnpm test pass locally — typecheck passed; full suite not completed, known baseline failure detailed above.
  • Server behavior changes come with tests.
  • No dist-server/ edits.
  • Portable CLI helpers; no shell: true or cmd.exe string-building.
  • No credentials added to logs, responses, events, or argv.

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