test(sandbox): wait for the fake CLI's AGENTS.md record to be written - #3201
Merged
Conversation
The fake openclaw records the AGENTS.md it saw through a shell redirection, which creates and truncates seen.txt before cat fills it. waitForSeen returned on existence alone, so on a busy runner it could read the empty in-between state and the AGENTS.md safety cases failed with Expected "TALE SYSTEM PROMPT v1", Received "" — observed on five of seven recent pull-request Unit runs. Wait for a non-empty record instead; both fake-CLI branches write one.
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.
Why
The
tale-openclaw-run AGENTS.md safetycases inservices/sandbox-runtime/daemon/src/tale-openclaw-run.test.tsfail intermittently in CI withObserved on five of the last seven pull-request
Unitruns (#3173, #3175, #3183, #3197, #3198), never onmain— a timing flake on the shared runners.Root cause
The fake
openclawrecords the AGENTS.md it saw withcat … > "$FAKE_SEEN". The shell redirection creates (and truncates)seen.txtBEFOREcatfills it, andwaitForSeen()returned as soon as the file existed — so on a slow runner it read the empty in-between state.Fix
waitForSeen()now waits for a non-empty record. Both fake-CLI branches write one (<absent>for a missing file), so the loop cannot spin on a legitimately empty result; the 10s deadline is unchanged.Test-only;
bun test src/tale-openclaw-run.test.tsinservices/sandbox-runtime/daemon: 5 pass.