Repository navigation
test(copilot): keep the browser fixture's node process name so WSL reports its argv - #3504
Conversation
…ports its argv On WSL herdr does not read the cmdline of a process named after an agent, so the fixture renamed to copilot had no argv and devswha#3189's ownership check failed closed. Running as node copilot.js matches an npm-installed Copilot. Co-authored-by: Copilot <[email protected]> Copilot-Session: 03511a3a-c861-4657-b123-934fa3dbd976
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Merge passMerged head
Merged with these checks red, none of them required: ssh;
|
…opened output left the end (#3654) ## Change Fixes a flaky browser script, `scripts/copilot-chat-browser-qa.ts`, which timed out waiting for `Follow-up answer.` (`TimeoutError: waitFor: Timeout 15000ms exceeded`). In about 30 h of CI, 10 runs needed a second attempt for it: 9 at that wait and 1 at the next turn, `Autopilot finished this task.`. The latest was run 42954642665. ### Cause A race in the script, not a product bug. Before the follow-up turn is written, the script opens the shell tool's whole output. The chat treats that as reading (#1388): it stops following the end and shows "New messages" for turns that arrive. The list draws rows only within 400 px of the view, so the answer row was never created and the wait could not find it. Whether the row landed inside that window depended on where the list settled after the clicks. A failure traced in the self-hosted CI runner image shows this: - The server was right: its change push came 52 ms after the append, and the next read returned the turn. - The page showed "New messages", and its drawn rows stopped at `Follow-up prompt`, 886 px above the end. The CI logs show no conversation-read failures either. ### Fix The script waits for either the answer or the pane's own "New messages" button. If the button shows, it clicks it as a reader would, then waits for the answer. Back at the end, the chat follows the next turn too. No sleep, no longer timeout, no product change. ## Validation - In `herdr-ci-runner:local`, the script ran next to three other looping browser scripts, with `main`'s script and the fixed one alternating in the same container: `main` failed 7 of 30 runs, all at `Follow-up answer.`; the fix passed 30 of 30. The final version, which looks for the button only inside the chat's own pane, passed 15 of 15, 2 of them through New messages. - `#3504` (merged before every failure) did not fix this, and no open PR touches the script. - `bun run check fast` on this branch, rebased on main fbcf093: every step passed except one unit test unrelated to this change, `server/pc-install.test.ts` "starting a stopped server again as it was > starts nothing when its address is taken by a live server, and keeps its log this account's alone" (`:1079`). This diff does not touch that file, so it is the same as on `main`. Run alone it failed 1 of 5 times, so it is a separate flake; it is being tracked on its own. - Not run: `check full`, other browser scripts. Test-only, so no changelog fragment.
Change
scripts/copilot-chat-browser-qa.tsfails on WSL: the Chat endpoint answerssource: "scrollback"(copilot_process_set_unproved) instead ofcopilot-transcript.On WSL, herdr (0.9.3 to 0.9.5,
process_allows_remote_memory_readinsrc/platform/linux.rs) doesn't read/proc/<pid>/cmdlinefor a process whosecommnames a known agent. That read can hang inaccess_remote_vmthere. The fixture setprocess.title = "copilot", so herdr reported it withoutargv, and since #3189 such a process set is unproven and fails closed.The fixture now keeps node's own process name and runs as
node <root>/copilot.js, like an npm-installed Copilot. herdr detects the pane ascopilotfrom that argv, andagentProcessesmatches it as an interpreted agent. The real Copilot CLI doesn't rename its process either. No assertion or ownership check changes.Validation
bun run check run --build bun scripts/copilot-chat-browser-qa.tson WSL2 (herdr 0.9.5): fails before this change, passes after (all steps, including PTY send and transient recovery).copilotorclaudeare reported without argv;node x.jsand a node symlink namedfooare reported with it.