Skip to content

test(sandbox): wait for the fake CLI's AGENTS.md record to be written - #3201

Merged
larryro merged 1 commit into
mainfrom
test/daemon-wait-for-seen-content
Sep 4, 2026
Merged

test(sandbox): wait for the fake CLI's AGENTS.md record to be written#3201
larryro merged 1 commit into
mainfrom
test/daemon-wait-for-seen-content

Conversation

@larryro

@larryro larryro commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Why

The tale-openclaw-run AGENTS.md safety cases in services/sandbox-runtime/daemon/src/tale-openclaw-run.test.ts fail intermittently in CI with

Expected: "TALE SYSTEM PROMPT v1"
Received: ""

Observed on five of the last seven pull-request Unit runs (#3173, #3175, #3183, #3197, #3198), never on main — a timing flake on the shared runners.

Root cause

The fake openclaw records the AGENTS.md it saw with cat … > "$FAKE_SEEN". The shell redirection creates (and truncates) seen.txt BEFORE cat fills it, and waitForSeen() 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.ts in services/sandbox-runtime/daemon: 5 pass.

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.
@larryro
larryro merged commit 078ab62 into main Sep 4, 2026
29 checks passed
@larryro
larryro deleted the test/daemon-wait-for-seen-content branch September 4, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant