Skip to content

fix(sessions): find a codex rollout marker under the session's CODEX_HOME - #830

Open
defangdevs wants to merge 1 commit into
masterfrom
fix/codex-rollout-uuid-codex-home
Open

defangdevs wants to merge 1 commit into
masterfrom
fix/codex-rollout-uuid-codex-home

Conversation

@defangdevs

Copy link
Copy Markdown
Owner

Summary

  • On respawn, codex_rollout_uuid looked for a session's [agent-box session <id>] marker only in ~/.codex/sessions. When a profile sets CODEX_HOME, that session's codex writes rollouts somewhere else, so the marker was never found and every respawn started a fresh thread instead of resuming.
  • start_session now resolves the session's Codex home once (resolve_codex_home "$sprofile", the same helper the standalone mirror and the AGENTS.md seed already use) and passes it to both codex_rollout_uuid and codex_registered_thread. With no profile override, the lookup falls back to ~/.codex exactly as before.
  • Follow-up to supervisor: resume a prompt-less codex session on its registered thread #826, which made the same fix for the registered-thread fallback only and left the marker lookup unchanged on purpose. Refs codex: prompt-less sessions are not resumed after a respawn/update (no marker to find the transcript) #825.

Test plan

  • tests/test-codex-registered-thread.sh (native, part of the whatsapp-cli check) has new cases: a marker found under a profile's CODEX_HOME; the same marker not matched when the default ~/.codex is searched; the default still resolving to ~/.codex when no home is passed; and start_session passing $cxhome to both lookups. Run against master's supervisor.sh, it fails with FAIL: marker under the session's CODEX_HOME not found.
  • nix run .#assemble, nix run .#update-golden and python3 tests/test_agentbox.py --update regenerated the module and the golden supervisor payload. The native expected tree did not change.
  • nix build --keep-going .#ci-native (the whole native set) exits 0 locally on x86_64-linux.
  • VM lanes: left to CI. The VM sessions test has no case that resumes a codex session.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RQayjSBQom6xiA256JuX3e

…HOME

codex_rollout_uuid only searched ~/.codex/sessions, so a codex session
whose profile sets CODEX_HOME never found its own "[agent-box session
<id>]" marker on respawn and started a fresh thread. Pass the session's
resolve_codex_home answer to it, the same as the registered-thread
fallback from #826 already gets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RQayjSBQom6xiA256JuX3e
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dd251f18-b752-4017-a06b-371a4fd94322
📥 Commits

Reviewing files that changed from the base of the PR and between dc8b869 and 069bec9.

📒 Files selected for processing (4)
  • modules/agent-box.nix
  • modules/src/supervisor.sh
  • tests/golden/vm/payloads/agent-box-supervisor/bin/agent-box-supervisor
  • tests/test-codex-registered-thread.sh
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

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

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant