fix(FAR-123): dedup replayed K8s log lines at the streaming UI boundary #7
Reference in New Issue
Block a user
Delete Branch "fix/far-123-duplicate-output-logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
sinceSecondsis integer-second with a +5s safety buffer. FAR-105 dedupped these replays only at the final parser (parse.ts), but the streaming UI consumes rawonLogchunks and still saw every duplicate.LogLineDedupFilter) wrapped aroundonLoginsidestreamPodLogs, shared across reconnects. Claude stream-json events are keyed by their stable structural IDs (message.id,tool_use_id,session_id); non-JSON output passes through unchanged.Changes
src/server/log-dedup.ts— new filter with chunk→line buffering, structural-key dedup, and end-of-stream flush.src/server/log-dedup.test.ts— 17 unit tests covering unique/replay cases, incomplete-line buffering, non-JSON passthrough, and the classic FAR-123 replay scenario.src/server/execute.ts— instantiate one filter per run, thread it intostreamPodLogsOnce, flush on stream end.Test plan
npm run typechecknpm test— all 241 tests pass (17 new)Three nits to fix…/The reviewer's nits are valid…entries no longer appear between tool calls in the live agent UI.🤖 Generated with Claude Code