Skip to content

Condense a failed agent's output (strip ANSI, dedupe, cap) - #46

Merged
eirikb merged 1 commit into
mainfrom
feature/eirikb/condense-failure-output
Jul 2, 2026
Merged

eirikb merged 1 commit into
mainfrom
feature/eirikb/condense-failure-output

Conversation

@eirikb

@eirikb eirikb commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

A failing agent could dump a wall of text that buries the others — grok on a 403 logs the same error five times, in ANSI colour, padded with blank lines. condense_failure() strips ANSI escapes, drops blank + exact-duplicate lines, and caps the block to 15 lines with an "N more omitted" note. The synthesizing caller still sees the error, once, instead of a stack-trace dump. No new deps (hand-rolled ANSI stripper). Build + clippy clean; verified live against grok's real 403.

A failing agent could dump a wall of text that buries the others - grok on
a 403 logs the same error five times, in colour, padded with blank lines.
Strip ANSI escapes, drop blank and exact-duplicate lines, and cap the block
to 15 lines with an "N more omitted" note. The synthesizing caller still
sees the error, once, instead of a stack-trace dump.
@eirikb
eirikb merged commit 9139b6b into main Jul 2, 2026
1 check passed
@eirikb
eirikb deleted the feature/eirikb/condense-failure-output branch July 2, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant