Skip to content

feat(experiment): validate opt-in Codex side-session transport - #246

Draft
abruption wants to merge 4 commits into
mainfrom
abruption/codex-side-session-245
Draft

abruption wants to merge 4 commits into
mainfrom
abruption/codex-side-session-245

Conversation

@abruption

@abruption abruption commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add a local-only, explicitly opt-in experiment for addressing a loaded ephemeral Codex thread through its existing owning app-server. Refs #245; the issue remains open. The review scope is this bounded research artifact, not general /btw support.

The adapter uses a private Unix-domain WebSocket, exact UUID selection, required absolute --expected-home matched against canonical server metadata, and a pinned 0.159.2 server version. It never resumes, forks, wakes, retries, redirects to a parent, changes permissions or answers approvals. Acceptance is separate from consumption and ACK.

RPC responses must contain exactly one result or error, with a matching integer request ID and typed error fields. Malformed or deeply nested JSON becomes a fixed refusal before input and an unknown outcome after an attempt. Malformed initialization/discovery fields cannot escape as tracebacks. Ordinary transport-close errors preserve the primary outcome, including known submission and unknown/no-retry results.

Changes are limited to experiments/codex_side_session/ and explicit offline experimental-suite execution in CI. Existing packaging excludes experiments; installed CLI/runtime, SSH/Relay and services are unchanged.

Validation

  • Current offline validation on macOS arm64/Python 3.13.7: 32 tests pass, with development mode and ResourceWarning-as-error. Tests use fake RPC/connection objects and make no native/model calls. Additional home/socket/version, approval-request and idle-to-native-rejection cases preserve one-shot semantics.
  • Independent subagent review findings were checked, fixed and re-reviewed. Standalone generator and diff checks pass.
  • Linux/macOS Python 3.13 CI now explicitly runs available Side Session/Steering experiment suites. No native fixture is launched by that step. Local verification also runs in a dedicated tmux session.

Historical native evidence and remaining gates

The preserved experiments/codex_side_session/RESULTS.md records the isolated native /btw test on macOS arm64 with Codex 0.159.2 and websockets 17.1: an exact on-screen side ACK and unchanged parent-turn hash, plus negative controls. That historical experiment was not rerun for these parser/cleanup changes. submitted:true still has consumptionConfirmed:false; no generic ACK/return-route workflow is implemented.

Two general-use blockers remain:

  1. The idle check and turn/start are not atomic; another producer can cause unintended steering. The exclusive-test-session flag acknowledges a dedicated single-producer restriction but cannot enforce it against native clients.
  2. Closing the side UI does not immediately unload its thread. Loaded/idle metadata does not establish current side-UI lifetime or generation.

The prototype classifies ephemeral threads as unclassified, not automatically as side conversations. Linux/Windows, SSH, arbitrary app-hosted endpoints, concurrent senders and general return-route integration remain unverified. No merge, publication or operational rollout is included.

@abruption

Copy link
Copy Markdown
Owner Author

Optional RPC robustness improvement: a present error must be an object with an exact integer code (not bool/float/null). Malformed error shapes use the existing pre-attempt refusal/post-attempt unknown handling instead of traceback; a plausible result beside an error does not mask it. Existing known-code classification and no automatic resend are preserved.

17 in-memory RPC tests pass on Python 3.9.6 and 3.13.7; modern/default-floor discovery and generation checks also pass. No real app-server/model/TUI/ACK was invoked. This does not satisfy the experimental feature's remaining provider/platform/lifetime gates; Draft retained.

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