Repository navigation
fix(compaction): only treat a single-line result as a success marker - #1645
qwist1233-cpu wants to merge 2 commits into
Conversation
compressToolResultDefault replaced a tool result with 'Result: success' when it matched /completed successfully/ or /no errors/ anywhere, so a multi-line log that also reported failures lost those lines. Anchor the patterns to the whole (trimmed) content and bail out on multi-line text. Closes Nano-Collective#1633
nc-review: comments — 1 nit@qwist1233-cpu — a few things worth a look, none blocking. The PR anchors the success patterns in ⚪ nit · The new pattern 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
A single-line result whose success phrase is not at the end, such as "Operation completed successfully in 5s", now takes the key-info path. It is not dropped: the whole line is kept as the result, which is more than "Result: success" carried. Signed-off-by: qwist1233-cpu <qwist1233@gmail.com>
|
On the nit: the wider scope is deliberate, and I checked that nothing is lost by it. so the key-info path keeps the whole line rather than replacing it with I kept the end anchor rather than allowing trailing text, because |
What
compressToolResultDefaultcollapsed a tool result intoTool: X\nResult: successwhenever the body matched/completed successfully/ior/no errors/ianywhere, whilesuccess/ok/donewere anchored. A log such aslost its
failures: 3line after/compact.How
isSuccessnow trims the content, returnsfalsefor anything multi-line, and anchors the two phrase patterns to the whole text (/^.{0,80}completed successfully\.?$/i,/^no errors\.?$/i). A single-lineBuild completed successfullyis still a success marker; a multi-line log falls through to the existing key-info / first-line path.Verified
npx ava source/utils/message-compression.spec.ts: 31 passed (two new tests: multi-line log with failures is not collapsed; single-line "completed successfully" still is).compressMessages keeps a log that mentions success but also reports failuresfails, so the test exercises the bug.biome checkon both files clean,tsc --noEmitclean.patch).Closes #1633