Repository navigation
fix(flaky): qa-only diagnostic reads browse-daemon.log; router cases score a long session; two diagnostics (GST-1632) - #4074
Merged
Conversation
…score a long session; retention and welcome tests name their cause (GST-1632) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
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.
What changed
A router failure-routing session that hangs after it has routed used to die at Bun's 300 s kill; it now stops at 290 s and the routing contract decides the verdict (forced probe with a fake CLI, no API spend).
Before/after as text: A session that hangs after routing used to die at Bun's 300 s kill; it now stops at 290 s and the routing contract decides the verdict (forced probe with a fake CLI, no API spend)
Daily flaky pass for 2026-11-06 (GST-1632). Test-only: no product code, threshold, trial count, case kind or model budget changes.
test/helpers/qa-only-cleanup.ts). The "terminal identity is unavailable" failure read terminal-agent lines frombrowse-server.log, but a CLI-spawned daemon writes its output tobrowse-daemon.log(browse/src/cli.tsdaemonLogPath()), so the log part always printed "none". It now readsbrowse-daemon.log, and the missing-terminal case asserts the message carries the daemon line.test/skill-e2e-failure-routing.test.ts). The session timeout equalled the Bun test timeout (bothCAPTURE_MS), so a long session was killed by Bun beforerunSkillTestreturned, and the case never reached scoring. The session now getsCAPTURE_MS - 10 s; the test timeout is unchanged and the model's budget only shrinks.test/bootstrap-retention-shard.test.tsprints the paid shard's log lines and names its outcome when the status is wrong, andbrowse/test/xvfb.test.tsprints the daemon log tail when the page is not the welcome page.Why
"Router failure-routing cases die at Bun's kill instead of being scored" and "the qa-only cleanup diagnostic always says none": both came from the 2026-11-06 flaky harvest. A long session is now scored on the routing it already did, and the next qa-only, retention or welcome red names its own cause.
Blast radius
Test files and one changelog fragment only; no product module imports them. The router change only shortens the session deadline under an unchanged test timeout, and a forced probe with a fake CLI showed a routing regression still fails 4 of 4 cases on both main and this branch (script ran).
Verification
bun test test/qa-only-cleanup.test.ts -t missing-terminal: fails with the helper change stashed, passes with it.bun test test/bootstrap-retention-shard.test.ts4/4,test/eval-budgets-policy.test.ts,test/touchfiles*.test.ts,test/failure-routing-arm.test.ts,test/eng-finding-retry-budget.test.tspass.bun run typecheckclean;typecheck:test: 812 known diagnostics, none new.Approvals
No approvals recorded for branch capy/gsta348-flaky.
Summary
Four flaky tests now say why they failed, and the router failure-routing cases score a long session instead of losing it to Bun's kill.
Test Coverage
All changed code is test code; the focused lane ran every changed free test file.
Tests ran: focused 50
Tests ran: free 1610 (files, carried from the PR's verified free-tests CI run at this tree)
Pre-Landing Review
No issues found.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2
Gate edits: none detected (8 listed, 7 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Test-only flake fix, P(fail | routing regression) from a forced probe (fake CLI that edits before routing, then hangs): main 4/4 fail (Bun timeout), this branch 4/4 fail (routing contract). Control (routes to /investigate, then hangs): 2/2 investigate-route cases pass on this branch.
Outside review: openai/gpt-6.1-sol (host subagent, reasoning high) completed with no findings.
Exploratory QA
Not applicable: test-only diff, with no product source, prompt or template changed. The changed tests themselves ran in the focused lane (50 pass) and the router cases in focused paid runs.
Design Review
No frontend files changed — design review skipped.
Eval Results
Selector (PR profile): behavioral probe qa-bootstrap; the four router-failure cases are deferred to broad coverage and were run as focused cases.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
Verification Results
No plan-specific verification items (bug-fix flaky-pass repair, exempt from plan review).
TODOS
No TODO items completed in this PR.
Documentation
Scope: the diff
1a06afdc..12fa10a(six files: five test or helper files plus one changelog fragment). The candidate lists 141 docs. Nothing was staged, unstaged or untracked. Result: current. The test-only diagnostic changes (thebrowse-daemon.logfilename in the qa-only cleanup helper, the 10-second score grace on failure-routing timeouts, extra failure output in the xvfb and bootstrap-retention tests) are not described by any doc, and the existingbrowse-daemon.logreferences indocs/standalone-binaries.mdalready use the current name. No files were edited. Debt: none found; only the five files listed infiles_reviewedwere read in full, and the other candidate docs were checked by keyword search only.Test plan
bun test --timeout=30000 test/qa-only-cleanup.test.ts test/bootstrap-retention-shard.test.ts browse/test/xvfb.test.ts: 50 pass, 0 failbun run test: carried from the PR's free-tests CI run at tree fb1fb5e0669e (1610 files)🤖 Generated with Claude Code