Skip to content

fix(flaky): qa-only diagnostic reads browse-daemon.log; router cases score a long session; two diagnostics (GST-1632) - #4074

Merged
capy-ai[bot] merged 1 commit into
mainfrom
capy/gsta348-flaky
Nov 6, 2026
Merged

capy-ai[bot] merged 1 commit into
mainfrom
capy/gsta348-flaky

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4074,
  "head": "12fa10a513ab33d477ebb58c5f642d319393ce60",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 50,
      "fail": 0,
      "skip": 0
    },
    "free": {
      "pass": 1610,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42232662780,
      "attempt": 1,
      "tree": "fb1fb5e0669e333aa961114359af7846101ccee0"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "fb1fb5e0669e333aa961114359af7846101ccee0",
  "product_patch_id": "none",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "light",
    "class": "tests",
    "runtime_lines": 0,
    "rules": "70895942bb8a8ee2",
    "base": "1a06afdc19b18904c005495fec2af79f40800565",
    "registry": "1a06afdc19b18904c005495fec2af79f40800565",
    "gate_scan": {
      "tagged": 0,
      "head": "12fa10a513ab33d477ebb58c5f642d319393ce60"
    },
    "reasons": [
      "runtime=0"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @fb1fb5e0669e (7 checks, current for 12fa10a513ab)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42232662780/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=fb1fb5e0669e tests=35933 skipped=69 runs=42232662780/1 profiles=ci-reuse/free-tests heads=12fa10a513ab verified=2026-11-06T14:26:18.724Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md (141 docs; 5 read in full, the rest by keyword search)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2
  }
}

What changed

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

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)
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ bun test test/skill-e2e-failure-routing.test.ts   # this branch, same fake CLI: Read, Edit, then hangs
+(fail) router-failure-verified-cause [290141.76ms]
+(fail) router-failure-contradicted-cause [290107.74ms]
+(fail) router-failure-triage-resolves [290078.41ms]
+(fail) router-failure-triage-unclear [290164.46ms]
-$ bun test test/skill-e2e-failure-routing.test.ts   # main 1a06afd, fake CLI: Read, Edit, then hangs
-(fail) router-failure-verified-cause [300029.84ms]
-  ^ this test timed out after 300000ms.
-(fail) router-failure-contradicted-cause [300000.08ms]
-  ^ this test timed out after 300000ms.
-(fail) router-failure-triage-resolves [300026.09ms]
-  ^ this test timed out after 300000ms.
-(fail) router-failure-triage-unclear [300000.10ms]
-  ^ this test timed out after 300000ms.
  0 pass
  4 fail
+ContractViolation: CONTRACT: edited before /investigate on an unverified cause: arm=current route=investigate reads=1 gr
+
+# control: Read, Skill(investigate), then hangs
+(pass) router-failure-contradicted-cause [290084.74ms]
+(pass) router-failure-triage-unclear [290119.60ms]
 

Daily flaky pass for 2026-11-06 (GST-1632). Test-only: no product code, threshold, trial count, case kind or model budget changes.

  • qa-only-no-fix cleanup diagnostic (test/helpers/qa-only-cleanup.ts). The "terminal identity is unavailable" failure read terminal-agent lines from browse-server.log, but a CLI-spawned daemon writes its output to browse-daemon.log (browse/src/cli.ts daemonLogPath()), so the log part always printed "none". It now reads browse-daemon.log, and the missing-terminal case asserts the message carries the daemon line.
  • router-failure- paid cases* (test/skill-e2e-failure-routing.test.ts). The session timeout equalled the Bun test timeout (both CAPTURE_MS), so a long session was killed by Bun before runSkillTest returned, and the case never reached scoring. The session now gets CAPTURE_MS - 10 s; the test timeout is unchanged and the model's budget only shrinks.
  • Diagnostics (no behavior change): test/bootstrap-retention-shard.test.ts prints the paid shard's log lines and names its outcome when the status is wrong, and browse/test/xvfb.test.ts prints 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.ts 4/4, test/eval-budgets-policy.test.ts, test/touchfiles*.test.ts, test/failure-routing-arm.test.ts, test/eng-finding-retry-budget.test.ts pass. bun run typecheck clean; typecheck:test: 812 known diagnostics, none new.
  • The qa-only "real Chromium" cases and the Xvfb lifecycle cases need Playwright's Chromium; after installing it, /ship's focused lane ran all three changed free files 50/50.

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.

  • qa-bootstrap: PASS 1/1, $0.09 (local run, PR lane)
  • router-failure-verified-cause PASS $0.09, router-failure-contradicted-cause PASS $0.11, router-failure-triage-resolves PASS $0.07, router-failure-triage-unclear PASS $0.13 (rule, 1 trial each; local, pinned Claude CLI 2.1.292)

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 (the browse-daemon.log filename 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 existing browse-daemon.log references in docs/standalone-binaries.md already use the current name. No files were edited. Debt: none found; only the five files listed in files_reviewed were 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 fail
  • bun run test: carried from the PR's free-tests CI run at tree fb1fb5e0669e (1610 files)
  • Focused paid cases: qa-bootstrap and the four router-failure cases, 5/5 pass ($0.49)
  • Forced router probe with a fake CLI (no API spend): regression fails 4/4 on main and on this branch

🤖 Generated with Claude Code

Open in Capy

…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>
@trunk-io

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot merged commit 648b334 into main Nov 6, 2026
43 checks passed
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