Repository navigation
fix(plugin): wait for Codex stdin probe publication - #2094
Conversation
Treat an empty probe marker as pending rather than a completed EOF result. Hold fixture publication behind a reader-controlled barrier to reproduce the empty-file window deterministically, retaining data rejection, open parent stdin and existing deadlines. Verified focused regressions and go test ./plugin -count=1 on Linux with Go 1.25.10 against main aec0f4f plus this exact test candidate. No production hook changes. Refs: Gentleman-Programming#2072.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Probe publication and result validation plugin/codex_unix_user_prompt_test.go |
The mock curl process waits for a release signal before publishing whether stdin provided data or EOF. The test verifies the marker is initially empty, releases the probe, and checks its result. Helper tests cover an unpublished marker, EOF, and data. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers: gentleman-programming
Merge Risk: 
Minimal · up to 2db5c
-
The stdin-detachment test retains exact result validation. No identified issue prevents merging after normal checks.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "fix(plugin): wait for Codex stdin probe publication" matches the main change. The test now treats an empty stdin-probe marker as pending and waits for publication before validating the result, and a new helper (TestCodexPromptStdinProbeResult) covers the unpublished, EOF, and inherited-data cases. The title names the plugin, the Codex stdin probe, and the publication wait. It is specific, concise, and uses the conventional commit form. No search was needed for this check.
Full details: Linked Issues check
-
Explanation
Issue
#2072requires the test to distinguish an empty marker from a completed probe, preserve the detached-stdin EOF assertion, keep parent input open, verify adapter exit, and retain the existing deadlines. The changed test usescodexPromptStdinProbeResultto treat an empty marker as pending and validates exacteofanddataresults. The release file creates a deterministic publication barrier. The test still uses the stdin pipe, checks adapter exit, and keeps the one-second polling and exit deadlines. Table tests cover unpublished, EOF, and data results. No production hook code changed.
Full details: Out of Scope Changes check
-
Explanation
The whole pull request changes only
plugin/codex_unix_user_prompt_test.go. The changes add synchronization and regression coverage for the marker publication race in issue#2072. The helper tests and fixture cleanup support that objective. No unrelated production behavior, timeout relaxation, stdin assertion removal, or Windows missing-marker fix is included.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · 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.
Comment @coderabbitai help to get the list of available commands.
fcd9301
🔗 Linked Issue
Closes #2072
Lifecycle Evidence
🏷️ PR Type
type:bug— Bug fixtype:feature— New featuretype:question— Question requiring tracked worktype:docs— Documentation onlytype:refactor— Code refactoringtype:chore— Maintenance/toolingtype:breaking-change— Breaking change📝 Summary
📂 Changes
plugin/codex_unix_user_prompt_test.go🧪 Test Plan
3e0642074b8169419cb411ef0426d91145c8e462: hold publication after opening the marker while preserving the old validation; focused stdin test failed withdetached curl stdin = "", want EOF from /dev/null. Empty-result table case failed; EOF/data controls passed.go test ./plugin -run '^TestCodex(PromptStdinProbeResult|UnixUserPromptSubmitDetachesPromptPersistenceStdin)$' -count=1 -v— PASS, package 15.318s.go test ./plugin -count=1— PASS, 79.060s.git diff --check— PASS; only this test file is committed.Latest local GREEN ran on Linux/WSL, Go 1.25.10, native short
TMPDIR=/tmp/engram-2072, using an uninstrumented clean snapshot of merged mainaec0f4f0f6fa57aad594c9abf45fb7e0be67f68cplus only this exact test file. Its SHA256 matched the local candidate:3f41552dd1460965cf4f9314abb74bdf7729cf56e83ea0b8f7e6f1fc0dc72400.Earlier local evidence is not erased: Windows baseline failed with
prompt persistence did not finish the stdin probe, a missing-marker symptom not attributed to this empty-publication race. An earlier Linux package run with long mounted TMPDIR failed Unix socket binds and Claude fixture ancestry checks; socket checks passed with native TMPDIR and the Claude gap was reported as #2089, fixed by merged #2092. The fresh full plugin PASS above includes that merged fix. No fresh Windows candidate test, full module suite, E2E, lint or hosted CI result is claimed here.🤖 Automated Checks
GitHub checks are pending until they actually run on this PR head. Local Go plugin results are not the JavaScript Pi
Plugin TestsCI context.type:bugapplied on creation✅ Contributor Checklist
type:*label:type:bug.Co-Authored-Bytrailers..tmp/tooling is excluded.💬 Notes for Reviewers
The root cause is shell redirection creating/truncating the file before printf writes its contents. File existence/read success is not publication completion. Invalid nonempty results still fail with the original exact error. The fixture releases its barrier on test failure and stops waiting if its temporary directory disappears. No timeout increase, production parser/helper change, stdin guard relaxation or Windows missing-marker fix is included.
Risk: none — test-only behavior, no shared production code changed. Native assessment was unavailable because local untracked setup artifacts required a declaration; its RDD-off plan required writer self-verification only. No native review approval or merge readiness is claimed.
Summary by CodeRabbit