Skip to content

feat(codex): prototype native Side Session input in an isolated experiment - #82

Draft
abruption wants to merge 2 commits into
mainfrom
feat/codex-side-session
Draft

abruption wants to merge 2 commits into
mainfrom
feat/codex-side-session

Conversation

@abruption

@abruption abruption commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

The canonical saved-thread queue does not support native Codex /btw ephemeral Side Sessions. Add an isolated TypeScript experiment that connects to the existing owning app-server over a private Unix WebSocket and submits one exact-target input only under an explicit dedicated single-producer prerequisite.

The prototype requires loaded/ephemeral/idle/direct-input metadata, limits frames/inventory/timeouts, refuses unexpected approval interactions and never resumes, forks, falls back to a parent or retries an uncertain submission. Its private manifest pins ws 8.22.0 outside root dependencies. All six changed files are under experiments/codex_side_session/; npm packaging excludes them.

Refs #81; milestone Future — Agent integrations. Keep this PR Draft and the issue open: the experiment establishes transport feasibility, not general-use safety.

Actual TS validation

macOS arm64, Node 24.16.0, Codex CLI/server 0.159.2:

  • A dedicated native TUI created a real /btw; no API-fork substitute.
  • Exact-target dry-run passed, followed by one turn/start input. The rendered side TUI independently displayed ACK TS81-SIDE-ROUNDTRIP-20260930.
  • Parent remained idle with one turn and the same serialized-turn hash. Adapter refused the persistent parent; native side queue probe returned RPC -32600.
  • After Ctrl+C closed the side UI, the retained side still passed a dry-run. No further input was sent.
  • Strict type checking and 20 contract/actual Unix-WebSocket fixture tests passed. Audit found zero vulnerabilities. Existing package/repository checks passed; packed contents were unchanged and exclude the experiment.
  • Dedicated TUI/server PTYs and their test record/socket were cleaned up; unrelated work preserved.

See detailed results.

Unmet gates

turn/start invokes native start_or_steer_turn; the idle preflight cannot atomically exclude concurrent input. The exclusive-test flag does not lock out other clients. Loaded metadata also does not prove the UI remains open: cooperating-owner active registration/generation is needed.

No concurrent-race or multi-client approval test, live Linux/Windows/SSH/Orca shared-server validation, general ACK wait or automatic Reply-To. No canonical CLI, release, global installation or npm publication changes. This experimental adapter is not exposed by the installed CLI.

Response classification correction — 2026-10-14

Current correction head: 0e8ad2077d5701d1be7837d168998f448c659f5d.

  • A matching RPC response must contain exactly one of result and error.
    Native refusal requires an error object with a safe integer code. Contradictory
    or malformed envelopes terminate the experiment connection; after an input
    attempt they produce unknown, submitted:null, retryAllowed:false.
    Valid standalone -32600 / -32601 refusal remains refused.
  • Added 12 private fake WebSocket-over-Unix + actual experiment main() output
    cases for contradictory/missing outcomes, malformed error codes, and clean
    refusal/internal-error controls. Every case observed exactly one turn/start,
    no queue/fallback/replay, and no message content in output.
  • Restoring only the original adapter made the three contradictory result/error
    regressions fail: 29 passed / 3 failed. Restoring the correction gave 32/32
    tests passed
    on macOS arm64 / Node 24.16.0. npm run typecheck passed;
    npm ci --ignore-scripts audited six packages with zero vulnerabilities;
    git diff --check passed.
  • Only three experiment files changed. The historical 0.159.2 native results
    above were not repeated and do not establish current Codex/platform support.
    The existing idle/admission, active UI lifetime, owner generation, concurrent
    producer, Linux/Windows/SSH and ACK limitations remain. Keep Draft; no merge,
    release, packaging/runtime/operations change or new live/native/model test.
  • The root CI does not execute this isolated experiment test suite. The 32-test
    result is local fake-owner evidence, not a claim of CI/live native coverage.
    Exact-head repository CI 38488449887
    completed successfully (macOS/Ubuntu Node 22/24, Windows native 22/24,
    policy and release gate). CodeQL 38488444554
    and GitGuardian passed: 12/12 current-head checks. These root checks do
    not run the 32 scoped experiment tests. No automatic review finding on this
    correction head was observed at this checkpoint; review completion is not
    claimed. PR remains Draft, unmerged.

@abruption

Copy link
Copy Markdown
Owner Author

Validation complete at head a6d1daff62d9fee7556fcebba18510136c457e38.

  • CLI/package compatibility CI: all 8 jobs passed, including release gate. CodeQL and security checks passed.
  • Manual experimental checks: strict TypeScript check, 20 contract/actual Unix-WebSocket tests, audit (0 vulnerabilities), exact package smoke and repository checks passed. Experimental tests are not part of the root CI suite.
  • Actual native /btw on macOS arm64 / Node 24.16.0 / Codex 0.159.2: exact side ACK observed, parent hash unchanged, parent target refused, side queue probe rejected.
  • UI dismissal still left the side dry-run validated. No subsequent input. Concurrent steering race is not solved or adversarially tested. Linux/Windows live side-session tests remain unverified.
  • Dedicated server/TUI PTYs, created parent record, socket/rendezvous and unheld test startup lock were cleaned up; other resources preserved.

PR remains Draft and #81 remains open until the general-use gates are met. No merge or publication.

This branch has not been deployed

No deployments
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