fix: record optional Codex profile metadata without changing delivery - #1549
Merged
Merged
Conversation
2 tasks done
fujibee
added a commit
that referenced
this pull request
Oct 2, 2026
## Summary Merge `main` (1.5.2) into `integration/agmsgd-beta`. Main now carries the optional Codex profile field in the seat record (#1549), which overlaps this branch's profile recording (#1504). Conflict resolution: - `scripts/drivers/types/codex/codex-record-session.sh`: one profile resolution instead of two. A missing, relative or malformed profile no longer skips the seat record (main's behavior): the record is written without the profile, and rollout discovery falls back to `$HOME/.codex` as before. A resolved profile is still used for rollout discovery and stored for delivery. - `scripts/drivers/types/codex/template.md`: keep this branch's wording, since here the profile routes notices. - `tests/test_spawn.bats`: take main's equivalent `CODEX_HOME` keep entry. ## Test plan - [x] `bats tests/test_codex_resume.bats`: 37/37 locally, including main's "unresolved profile omits only the field" case and this branch's profile discovery cases. - [x] `bats tests/test_role_session.bats` (22) and the spawn reader-inventory test pass locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract only the optional Codex profile metadata from #1504 for the maintenance release. When the effective CODEX_HOME (or the default HOME/.codex) resolves to a physical absolute directory, record it as an optional codex_home field alongside the existing thread, type, project, and owner. Missing directories, control characters, relative paths, or failed resolution omit only this new field; they do not skip writing the existing session record.
Keep rollout discovery at HOME/.codex/sessions. Thread selection, app-server probing, bridge requests, and the existing best-effort record-writing behavior retain their main-branch behavior. The Codex template describes optional profile metadata without implying a routing change.
Evidence that existing features are unaffected
rg -l 'codex_home' scriptsreports exactly scripts/drivers/types/codex/codex-record-session.sh and scripts/lib/role-session.sh: the producer, its optional argument, and its conditional field write. There is no reader of the stored field in main's bridge, hook, watch, send, or receive paths. Existing CODEX_HOME environment handling elsewhere does not read this new record field.|| trueis unchanged. The existing unavailable-run-directory regression still passes. No new directory is created for a profile.The spawn reader-inventory test explicitly allows CODEX_HOME because spawned Codex seats intentionally inherit the same profile. Spawn already preserved this variable; only the test inventory changes now that the recorder reads it.
Validation
bats tests/test_codex_resume.bats tests/test_role_session.bats: 59/59 PASS (35 existing resume + 2 new resume + 22 existing role-session checks).bats --filter "codex template:" tests/test_codex_resume.bats: 1/1 PASS.git diff --check: PASS.Validation uses the existing isolated test fixtures on macOS. No live service, message queue, or user profile settings were changed. The existing Bats minimum-version warning remains in an unchanged test.
Targets main from bb94ebe. Review should specifically assess whether existing features retain their behavior. Merge requires separate explicit approval.