Repository navigation
Conversation
…es in agent transcripts
🦋 Changeset detectedLatest commit: 84cab75 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Review live A/BNo reviewable delta: review.md is byte-identical in both arms (baseline |
Guidance for reviewersTriage notes for reviewers: risky files by owning team, repeated changes, and files excluded from review. github-actions (2 files)
review detailsreview-v1.25.0 | schema 2 | depth full | re-review scoped blocking-medium | enable holistic,completeness,test-adequacy,first-principles,conventions,documentation |
There was a problem hiding this comment.
Lower-confidence observations (7; top: `workflows/review/eval/live-runner.ts:358` question (non-blocking): The `finally` block overwrites `outcome.status` with `"timeout"` whenever `abort.signal.aborted` is true, with no guard...)
workflows/review/eval/live-runner.ts:358question (non-blocking): Thefinallyblock overwritesoutcome.statuswith"timeout"wheneverabort.signal.abortedis true, with no guard for the"success"status set at line 304, so a dispatch that returned a successful result can still be recorded as a timeout. (skill-auditor (out-of-lane))workflows/review/eval/live-runner.ts:321suggestion (non-blocking): The newoutcome.errorMessagecapture from a result-levelerrorfield has no test; add one scripting a success result that carrieserror. (test-adequacy)workflows/review/eval/live-runner.ts:293suggestion (non-blocking): The result branch now keeps two parallel accumulators for the same values — consider deriving the returned fields fromoutcomeinstead. (first-principles).changeset/review-transcript-metadata.md:5suggestion (non-blocking): Changeset body starts without thereview eval:summary line every other eval changeset in this folder uses. (conventions)workflows/review/eval/live-runner.ts:284question (non-blocking): Should a failed attempt's cost/usage also be carried onLiveAgentError.partialso the report stops under-counting, instead of being recorded only in the transcript? (first-principles)workflows/review/eval/live-runner.ts:296question (non-blocking): Does the SDK result message actually carry anerrors: string[]field, or is this branch only reachable from the mock? (completeness)workflows/review/eval/transcripts.ts:46suggestion (non-blocking):usagenames two incompatible shapes in one transcript file — the raw per-message snapshot and the SDK result totals — with the "don't sum these" rule living only in README prose; consider renaming the message-level field. (holistic)
review details
review-v1.25.0 | schema 2 | depth full | re-review scoped blocking-medium | enable holistic,completeness,test-adequacy,first-principles,conventions,documentationreview fingerprint
pr-reviewer:rereview v=1 depth=full verdict=APPROVE anchor-draft=false hunks=eyIuY2hhbmdlc2V0L3Jldmlldy10cmFuc2NyaXB0LW1ldGFkYXRhLm1kIjpbImQ3ODg3NmY2OWI1ODhhMGYiXSwid29ya2Zsb3dzL3Jldmlldy9ldmFsL1JFQURNRS5tZCI6WyI3MjRmNmZhYjk4ODUxNDI0Il0sIndvcmtmbG93cy9yZXZpZXcvZXZhbC9saXZlLXJ1bm5lci50ZXN0LnRzIjpbIjFlY2JhNmY5MDEzNmYxNDciLCI3Yjg2NWQwMjI3ODAwNzEyIiwiYjNhYmFlMTExYmI0Y2VhYiJdLCJ3b3JrZmxvd3MvcmV2aWV3L2V2YWwvbGl2ZS1ydW5uZXIudHMiOlsiOWI1M2FiMzc1YjhlMjkwZiIsImY3NzRlYjdhYTIyNDBmYWQiLCJkMWRhMTY4ZmNjYzM1NmZiIiwiODBkY2EzNTA5MTE2YTQ2OCIsImQwNGI4Y2UxNTlmMzQyODMiLCI4NTE0Njc5NmI0Y2M0NGIxIiwiYzFiOGVkM2MzYzQ3NTA4OCIsIjRjNzBjNTY3ZmEyY2FhMzUiLCI2NGI2MGZiZjIwZGNmODExIl0sIndvcmtmbG93cy9yZXZpZXcvZXZhbC90cmFuc2NyaXB0cy50cyI6WyIwYzA5MTg2MGNlOTI0ZDY3IiwiYjYxOTlhYmNiMDFmYWFkNSIsImY2MWRmNWNhMDRkMWRiMjIiLCJhOTVjOGEyNzhhNTFiNDA1Il19| // An SDK stream can close on abort without throwing. | ||
| if (abort.signal.aborted) { | ||
| outcome.status = "timeout"; | ||
| outcome.errorMessage ??= String(abort.signal.reason).slice(0, 500); |
There was a problem hiding this comment.
suggestion (non-blocking): The finally-path timeout message keeps the "Error: " prefix that the catch path strips, so the same timeout is recorded under two different strings.
context
The finally-path timeout message keeps the "Error: " prefix that the catch path strips, so the same timeout is recorded under two different strings. abort.abort() at line 121 passes an Error as the abort reason. The catch path at line 341-343 unwraps it with error.message; the new finally path at line 359 stringifies the reason object instead (String(abort.signal.reason)), which yields "Error: " + message. Both branches describe the identical event — the wall-clock timer fired — but write different text into the same outcome.errorMessage field the README says is the bounded error detail. The new tests enshrine both spellings: live-runner.test.ts:246 expects "sub-agent timed out after 5ms" and live-runner.test.ts:258 expects "Error: sub-agent timed out after 5ms", so the suggested fix needs that second expectation updated too. Introduced by this change.
found by correctness-reviewer | also flagged by skill-auditor (out-of-lane); completeness; holistic
| outcome.errorMessage ??= String(abort.signal.reason).slice(0, 500); | |
| outcome.errorMessage ??= ( | |
| abort.signal.reason instanceof Error | |
| ? abort.signal.reason.message | |
| : String(abort.signal.reason) | |
| ).slice(0, 500); |
| /* -------------------------------------------------------------------------- */ | ||
|
|
||
| type Script = {messages: unknown[]; throwAfter?: Error}; | ||
| type Script = {messages: unknown[]; throwAfter?: Error; waitForAbort?: boolean}; |
There was a problem hiding this comment.
suggestion (non-blocking): Script gained waitForAbort but not finishOnAbort, so the second new flag is untyped and nothing checks its spelling.
context
Script gained waitForAbort but not finishOnAbort, so the second new flag is untyped and nothing checks its spelling. The mock reads current.finishOnAbort at live-runner.test.ts:45 and :52 and the abort-close test sets it at :251, but the Script type on line 31 only declares waitForAbort. I grepped the whole workflows/ tree for finishOnAbort and it appears only in those three lines, so there is no declaration merge or augmentation supplying it. Nothing catches this today because tsconfig.json's include lists only actions/, utils/, types/, config/, and vitest.config.ts — workflows/** is outside pnpm typecheck, and vitest transpiles without type checking — which is why the PR's clean typecheck is not evidence here. Introduced by this change (the same hunk added the sibling waitForAbort field).
found by correctness-reviewer | also flagged by skill-auditor (out-of-lane) (at line 45): The mock branches on current.finishOnAbort and the test at line 251 passes {messages: [], finishOnAbort: true}, but the Script type at line 31 declares only waitForAbort?: boolean — the new flag is never added to the type.; test-adequacy (at line 45)
| type Script = {messages: unknown[]; throwAfter?: Error; waitForAbort?: boolean}; | |
| type Script = { | |
| messages: unknown[]; | |
| throwAfter?: Error; | |
| waitForAbort?: boolean; | |
| finishOnAbort?: boolean; | |
| }; |
| ); | ||
| } finally { | ||
| clearTimeout(timer); | ||
| outcome.wallMs = Date.now() - started; |
There was a problem hiding this comment.
suggestion (non-blocking): No test distinguishes a recorded wall time from the placeholder wallMs: 0; assert a lower bound in the timeout test.
context
No test distinguishes a recorded wall time from the placeholder wallMs: 0; assert a lower bound in the timeout test. outcome is initialized {status: "incomplete", wallMs: 0} (live-runner.ts:171) and wallMs is written in exactly one place, the finally at line 355. Every assertion on it in the new tests is wallMs: expect.any(Number) (grep for wallMs in live-runner.test.ts returns only lines 177, 205, 227, 244, 257, 267, 273 — all expect.any(Number)), which the placeholder 0 satisfies, so the only line that gives the field meaning is unguarded. The two timeout tests are the stable place to pin it: they pass timeoutMs: 5 and the mock generator waits on the abort signal, so elapsed time is necessarily >= 5ms — unlike the fast success paths, where Date.now() - started can legitimately be 0.
found by test-adequacy
| outcome.wallMs = Date.now() - started; | |
| const transcript = recorded("timeout"); | |
| expect(transcript.messages[0].usage).toEqual(rawUsage); | |
| expect(transcript.outcome.wallMs).toBeGreaterThanOrEqual(5); | |
| expect(transcript.outcome).toEqual({ |
|
Review-bot is moving into a private repo and this PR is stale. |
Summary
An eval transcript shows what a reviewer did, but diagnosing its cost or failure still means finding the matching report entry. Failed dispatches can leave no report usage at all. Each transcript now keeps the SDK result's cost, turns, and per-model token/cache totals beside its completion status, wall time, last assistant stop reason, and available error detail.
This extracts the remaining transcript metadata idea from #406 onto the SDK runner after #417 and #418, without bringing over pi code.
Test plan
pnpm exec vitest run: 2,401 tests pass across 124 files. Seven new mocked-SDK tests cover repeated message snapshots, error-result metering, transport failure, both timeout endings, missing versus zero totals, and a stream failure after a metered success result. Existing tests still cover per-attempt files, tool results, and a failed transcript write not losing the review result.pnpm run lintandpnpm run typecheckpass.KORE-2663