Repository navigation
Conversation
The row never held a heartbeat before settling, so last_heartbeat_at was null from creation and the assertion held whether the status filter did its job or something cleared the column on completion. Seed a heartbeat while the row is still dispatched, so the expected value is a timestamp: null now means the column was cleared and the later stamp means the guard is gone. Verified against both regressions.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 7 remain after this review. 📝 WalkthroughWalkthroughUpdated the completed-dispatch heartbeat test to record an initial heartbeat before dispatch completion. The test now verifies that a later heartbeat does not overwrite the existing timestamp. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thank you for this @Tauri-EPO — the regression-injection proof in your description is exactly the right way to argue for a test change, and it made review trivial. Fork PRs in this repo only run Three things I changed on takeover, all noted in the PR:
One more thing worth knowing — you were right to flag the overlap with #14889. Leaving this open for you to close once #15869 lands. |
|
Landed as #15869 — thank you @Tauri-EPO! 🎉 Your commit was cherry-picked and the squash carries a Good catch — the assertion really was vacuous. The merged PR adds mutation-proof output showing the new assertion fails against a broken straggler guard where the old one stayed green, plus coverage for failed dispatches. Closing this in favor of the merged PR. |
ELI5
A test says "a heartbeat arriving after the job finished is ignored". It checked that the heartbeat column ended up empty — but the column starts empty, so the test passed without the code doing anything. Now it puts a real heartbeat in first, so the check has something to actually compare against.
What Changed
One test in
src/main/runtime/orchestration/db.test.ts. No product code.it('recordHeartbeat is a no-op for completed rows (straggler ignored)', () => { const d = createDb() const task = d.createTask({ spec: 'work' }) const ctx = d.createDispatchContext(task.id, 'term_a') + d.recordHeartbeat(ctx.id, '2026-05-03T00:00:00.000Z') d.completeDispatch(ctx.id) d.recordHeartbeat(ctx.id, '2026-05-04T00:00:00.000Z') const after = d.getDispatchContext(task.id) - expect(after?.last_heartbeat_at).toBeNull() + expect(after?.last_heartbeat_at).toBe('2026-05-03T00:00:00.000Z') })Why
recordHeartbeatcarries a status filter with a stated reason:The test guarding it never gave the row a heartbeat before settling it, so
last_heartbeat_atwasnullfrom creation andtoBeNull()held for two different reasons: the filter excluded the row, or something cleared the column on the way tocompleted. It could not fail for the reason its name claims.Seeding a heartbeat first makes the expected value a timestamp rather than the initial state, so both regressions are now distinguishable —
nullmeans the column was cleared,'2026-05-04…'means the guard is gone.This is a test-only gap.
recordHeartbeatis correct today; nothing would notice if it stopped being.Linked Issue
Fixes #15164
Visual Proof
N/A— test-only change, no product code and no rendered UI. The before/after that matters is the assertion behaviour, shown under Testing.Testing
Verified by regression injection, since a test that cannot fail is only provable by making it fail. Injected into
completeDispatch:main's assertion, against that regression — green, which is the bug:This PR's assertion, same regression — red:
The injected change was reverted before committing; the diff in this PR is the test file only.
With the tree clean, on Windows 11 / Node 24.19.0:
pnpm lintruns clean through those and then stops atverify:skill-bundle-manifest— this is #14479, not this change:That is not from this change — it reproduces identically on a pristine detached
upstream/main(60805f5c) in the same checkout, and this PR touches one test file. Flagging it rather than regenerating artifacts that have nothing to do with the diff.Not run locally:
pnpm buildand the full suite. Platforms exercised: Windows only — the change is a SQLite assertion with no platform-dependent behaviour.AI Disclosure
Claude Opus 5 was used to write the regression-injection proof, the change, and this description.
Review
Reviewed for the areas the template asks about; none are touched. No product code, so no security, performance, cross-platform, SSH/remote, mobile, or backwards-compatibility surface. The only cross-cutting consideration is the SQLite timestamp format, and the test stays on the explicit ISO strings the surrounding cases already use, so it does not depend on wall clock or timezone.
Overlap worth flagging: #14889 relocates this exact test to
db-dispatch-liveness.test.tswithout changing it. Whichever lands first, the other rebases cleanly — if #14889 goes first this assertion moves to the new file; if this goes first the relocation carries it. I kept them separate deliberately: #14889 is a byte-for-byte move, and its whole value is that a reviewer can confirm nothing changed inside it.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — see Testing for exactly what was run:pnpm buildand the full suite were not, andpnpm lintstops on theverify:skill-bundle-manifeststaleness reported in [Bug]: pnpm lint cannot pass on a stock Windows checkout (CRLF line endings) #14479, which reproduces on pristinemainAuthor