Test fixtures inherit the Codex Desktop marker and select codex-app over fake terminal drivers

Closed Beginner friendly
#1,646 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash
Domain
cli, testing

Research direction

Read tests/test_helper.bash to see where fixtures clear ambient environment variables, then inspect scripts/drivers/terminals/codex-app/ops.sh and the native Codex App detection tests. Clear the desktop marker for ordinary fixtures and restore it explicitly in tests that exercise native detection. Run the affected Bats tests with and without the marker to confirm fake drivers are selected in fixtures while native detection still works when opted in.

Written by the indexing model from the issue text.

Description

Environment and reproduction

agmsg v1.6.0-rc.4, clean commit 3fb012a86203f227d67dc986b18c15733e702873, macOS, Codex App, Bats1.13.0. Tests use their existing fake terminal drivers and sandboxed HOME/TMP; no real terminal or message store was modified.

CODEX_INTERNAL_ORIGINATOR_OVERRIDE='Codex Desktop' bats tests/test_session_start_terminal_line.bats
env -u CODEX_INTERNAL_ORIGINATOR_OVERRIDE bats tests/test_session_start_terminal_line.bats

With the inherited marker, the plain/herdr/tmux cases choose codex-app; the same selected cases pass when only that variable is removed in the child environment. Equivalent baseline/control runs independently reproduce failures across self-fix, self-name, self-rename, terminal registry/context, capabilities, delivery, despawn, dispatch and spawn tests. The separate storage compatibility failures remain after marker removal.

Cause and expected boundary

tests/test_helper.bash clears ambient tmux, herdr, Claude profile and session markers at load/setup, but leaves CODEX_INTERNAL_ORIGINATOR_OVERRIDE. scripts/drivers/terminals/codex-app/ops.sh detects exact Codex Desktop; its priority1/exclusive detection then wins over fake terminal drivers installed by a test. This is intended production precedence applied to an unintentionally contaminated fixture.

Fixtures should clear the ambient desktop marker alongside the existing host/session variables. Tests intentionally exercising native Codex App detection should explicitly restore it. The native desktop-driver opt-in control passes under a clean child environment, so this report does not propose lowering production driver priority or disabling native delivery.

Child-only removal is a diagnostic workaround; no global App setting or production environment change is requested. This failure reproduces on unmodified RC and is separate from the Claude transcript-observer fix.

Dominant language
Shell
Stars
1.5k
Forks
156
Avg merge
16h 23m
Merged PRs (30d)
197

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fujibee/agmsg

All issues in fujibee/agmsg

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.