Skip to content

Fix Codex thread identity resolution#368

Merged
laulpogan merged 5 commits into
mainfrom
fix/codex-thread-identity
Jul 18, 2026
Merged

Fix Codex thread identity resolution#368
laulpogan merged 5 commits into
mainfrom
fix/codex-thread-identity

Conversation

@laulpogan

@laulpogan laulpogan commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Adds the current Codex runtime thread-ID adapter after the existing compatibility adapter, preserving explicit override precedence. Extends hermetic session-key fixtures and records the managed rollout plan.\n\nVerification: focused adapter, lifecycle, 655-home supervisor, relay-down, bilateral local-sister suites; clippy; canonical test-env/run.sh.

Summary by CodeRabbit

  • New Features

    • Added support for stable session identity across OpenAI Codex threads.
    • Preserved identity precedence and rejected unexpanded placeholder values.
  • Bug Fixes

    • Prevented Codex thread identifiers from leaking into isolated pairing, supervisor, and lifecycle subprocesses.
    • Ensured separate Codex threads receive distinct session contexts.
  • Documentation

    • Added design, deployment, verification, and session history documentation for Codex thread identity handling.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploying wireup-landing with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2b96e71
Status: ✅  Deploy successful!
Preview URL: https://49ae4d19.wireup-landing.pages.dev
Branch Preview URL: https://fix-codex-thread-identity.wireup-landing.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c63fcc48-2630-4195-8eaa-0e184cf714ea

📥 Commits

Reviewing files that changed from the base of the PR and between 03bfab6 and 2b96e71.

📒 Files selected for processing (9)
  • SESSION_LOG_2026_07_18.md
  • docs/superpowers/plans/2026-07-18-codex-thread-identity.md
  • docs/superpowers/specs/2026-07-18-codex-thread-identity-design.md
  • src/cli/pairing.rs
  • src/cli/session.rs
  • src/session.rs
  • test-env/runtime-210.sh
  • tests/session_lifecycle.rs
  • tests/supervisor_bounded.rs

📝 Walkthrough

Walkthrough

The change adds CODEX_THREAD_ID as a Codex session identity adapter, updates precedence and hermetic tests, removes the variable from isolated subprocesses, and documents verification, deployment, and removal of the fixed WIRE_SESSION_ID override.

Changes

Codex identity resolution

Layer / File(s) Summary
Identity contract and rollout plan
docs/superpowers/plans/..., docs/superpowers/specs/...
Documents CODEX_THREAD_ID precedence, safety requirements, verification steps, and deployment procedures.
Session-key resolution and validation
src/session.rs, test-env/runtime-210.sh
Adds CODEX_THREAD_ID resolution with the codex-cli source label and updates tests for distinct identities, precedence, placeholder rejection, and environment restoration.
Subprocess environment sanitization
src/cli/pairing.rs, src/cli/session.rs, tests/session_lifecycle.rs, tests/supervisor_bounded.rs
Removes CODEX_THREAD_ID from isolated Wire and test subprocess environments.
Deployment and verification record
SESSION_LOG_2026_07_18.md, docs/superpowers/plans/...
Records merge, installation, service restart scope, measurements, gate results, and the fixed WIRE_SESSION_ID removal plan.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Codex
  participant WireResolver
  participant SessionHome
  Codex->>WireResolver: Set CODEX_THREAD_ID
  WireResolver->>WireResolver: Apply adapter precedence and validation
  WireResolver->>SessionHome: Resolve hashed per-thread session home
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding and fixing Codex thread identity resolution.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/codex-thread-identity

Comment @coderabbitai help to get the list of available commands.

@laulpogan
laulpogan merged commit 4b9985c into main Jul 18, 2026
14 checks passed
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