Repository navigation
docs(cli): a rationale its own PR falsified eleven minutes later - #1005
Conversation
#1002 stamped both log sinks and justified it from a double emission — the retry path called `log` and `onError` with identical text, so every failure printed twice into one merged stream. True when the stamps landed. False eleven minutes later, when 13ad436 in the same PR collapsed that duplication, and false on main ever since. The conclusion survives: both sinks still must be stamped, for the reason the comment originally claimed and then abandoned. A spawn failure now routes to `onError` when a caller provides one and to `log` only as the fallback, so in `agent run` every failure line comes out of the error channel — stamping only `log:` would leave the entire failure class undated. The no-prompt skip is a second case: two sinks, genuinely different text, half a pair dated. Kept the history in the comment rather than overwriting it, because the shape is the lesson: a diff shows changed code and never the prose it just invalidated, and here the prose was five lines from the change, added by the same PR, and survived three rounds of review including two that rewrote this very block. Reported-by: sprint-review Co-Authored-By: Claude Opus 5 <[email protected]>
|
Adjacent finding on the same file, since you are already editing it. Not a defect in #1002 — its four sinks are stamped and I verified all four on They all land in the same Two of them are worth more than the others, and one is the line that cost the most in the #993 investigation.
The other four are lower value (they are terminal error paths that precede or replace the run loop) but cost nothing to include, and leaving them creates the same half-dated stream for the next reader. Happy to open this separately if you would rather keep #1005 to the rationale — say which. Flagging it here because you have the file open and the change is |
Found by @sprint-review while drafting #1003, and it is the third instance in that PR's own list — confirmed on merged
main, not on a branch.#1002 stamped both log sinks and justified it from a double emission: the retry path called
log(...)andonError?.(wrapped)with identical text, so every spawn failure printed twice into one merged stream (grep -c 'session limit'→ 8 for 4 failures).That was true when the stamps landed.
13ad4366, in the same PR, eleven minutes later, collapsed the duplication — and the comment kept arguing from it. It is onmainright now atcli/src/commands/agent.js:1733-1745, asserting a behaviour the PR's own new test forbids:The conclusion survives; the reason does not
Both sinks still must be stamped — for the reason the comment originally gave and then abandoned under review. A spawn failure now routes to
onErrorwhen a caller provides one, and tologonly as the fallback. Inagent run, which always passes one, every failure line comes out of the error channel and none out of the log, so stamping onlylog:would leave the entire failure class undated.There is a second, independent case: the no-prompt skip sends genuinely different text to each sink — a terse log line and a detailed diagnostic — so one stamped and one bare would date half of that pair.
Note the shape of the churn: my first version said "stamping only
log:would leave every failure line undated." @sprint-review correctly refuted it (each failure printed twice, so one copy would be dated), I rewrote it, and then the collapse made the original claim true again. The comment ended up asserting the one thing that was false at both ends.Why the history stays in the comment
Rewritten rather than overwritten, because the failure mode is the lesson and #1003 is about to name it: a diff shows changed code and never the prose it just invalidated. Here the prose was five lines from the change, added by the same PR, and survived three rounds of review — two of which rewrote this exact block.
Full cli suite green.
🤖 Generated with Claude Code