Conversation
…ing them elideLongBlocks hard-replaced any post-strip text over 2000 chars with '[output elided — N chars]', so a legit long deliverable (a 2.4KB pure-prose plan) synthesized as literally the marker — total data loss on the synthesis relay path (buildTaskResultLine posts completionSummary verbatim, no LLM pass). Regression from 3781312 (#11605); pre-commit the coordinator relayed record.response verbatim. - elideLongBlocks now truncates: head + '… [output truncated — N chars total]' marker, bounded to maxChars so the defensive re-sanitize in buildTaskResultLine is a no-op. - custom-validator completions: the verdict in record.summary ('App verification passed.') exists only on that record but was shadowed by record.response in the coordinator read ladder. It now leads the summary, with the sanitized deliverable appended under a budget that keeps the combined text inside the relay cap.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Post-merge validation pass from a PR worktree on current develop:
Reviewed the relay cap behavior and custom-validator path. The sanitizer now preserves the head of long pure-prose completions and appends a bounded truncation marker, while validated completions lead with the app-verification verdict and append the sanitized deliverable head. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
fix(orchestrator): truncate long completion relays instead of destroying them
Defect
elideLongBlocks(plugins/plugin-agent-orchestrator/src/services/transcript-sanitizer.ts) hard-replaced ANY post-strip text over 2000 chars with the literal string[output elided — N chars]— no truncation, total data loss. Regression from 3781312 (#11605); before that commit the coordinator relayedrecord.responseverbatim.Two concrete failure paths on
develop:[output elided — 2450 chars].sessionHasRouterOriginis false for these sessions so synthesis IS the relay path, andbuildTaskResultLine(packages/agent/src/api/server-helpers-swarm.ts) postscompletionSummaryverbatim to the connector — no LLM pass, no bypass for opencode/codex. The user receives the marker instead of their deliverable.runCustomValidatorAndDispatchspreadsenrichedData(retaining the raw ACPfinalTextinresponse) and addssummary: "App verification passed.". The coordinator read ladder takesresponsefirst, so whenfinalTextexceeds 2KB the user sees the elision marker — and the verdict, which exists ONLY on the custom-validator record (the rawtask_completewas withheld until validation), never posts at all.The router's own relay path never had this problem:
composeNarrationuses onlystripToolTranscript, and its 2KB verbatim cap applies to captured tool-output blocks with a summarized fallback. Synthesis-path-only regression.Fix
elideLongBlocksnow truncates: head +… [output truncated — N chars total]marker, with the whole result bounded tomaxCharsso the defensive re-sanitize inbuildTaskResultLineis a provable no-op (idempotent).swarm-coordinator-service.ts): for custom-validator completions the verdict inrecord.summarynow leads the completion summary, with the sanitized deliverable appended under a budget that keeps the combined text inside the relay cap.responseno longer shadows the only record of the validation outcome.Reproduction (failing tests on unmodified develop)
7 new/updated regression tests fail before the fix, reproducing both scenarios exactly:
Verification (after fix)
bunx vitest run __tests__/unit/transcript-sanitizer.test.ts __tests__/unit/swarm-coordinator-service.test.ts→ 63 passed (63)bun run test:unit→ 1276 passed (1276), 118 filespackages/agent/src/api/server-helpers-swarm.test.ts→ 13 passed (13)bun run --cwd plugins/plugin-agent-orchestrator typecheck→ cleanbunx biome checkon the four touched files → cleanEvidence notes
task_completeevent payloads the ACP service emits (response= raw finalText), which is the full real path for this bug (no model in the loop betweenrecord.responseand the connector post).Refs 3781312 (#11605), #11578.