Measure and reduce task-agent context amplification #1464

Closed
opened 2026-10-27 13:40:30 +00:00 by sam · 0 comments
Owner

PR #635 consumed at least 1,286,449 tokens across baseline repair, analysis, repro, and fix, while the PR footer reported only 997,900. Do not impose a hard token stop: successful and failed tasks are evaluation evidence. Measure prompt/completion/cached usage by stage and iteration, include every agent stage in task totals, enable adaptive history compaction, and bound redundant tool-result replay so task completion remains the authority while efficiency becomes observable and improvable.

Acceptance criteria

Task telemetry attributes prompt, completion, cached, total tokens and iterations by workflow stage; baseline-repair usage is included in task totals; task agents compact redundant accumulated history without imposing a token stop; successful and failed tasks remain comparable; regression coverage and quality gate pass.

Notes

Maintainer decision: max_tokens is not desired as a blocker. Optimize context economics and preserve outcomes as metrics.

Close reason

Provider usage is durable by stage, baseline repair is included, model-adaptive compaction is enabled without a token cap, and ai-sdk preserves partial/compaction usage. task check and fresh adversarial review pass.


Imported from beads archie-core-n5sr · GitHub #637 · type bug · priority P0 · created 2026-08-24 · closed 2026-08-24

PR #635 consumed at least 1,286,449 tokens across baseline repair, analysis, repro, and fix, while the PR footer reported only 997,900. Do not impose a hard token stop: successful and failed tasks are evaluation evidence. Measure prompt/completion/cached usage by stage and iteration, include every agent stage in task totals, enable adaptive history compaction, and bound redundant tool-result replay so task completion remains the authority while efficiency becomes observable and improvable. ### Acceptance criteria Task telemetry attributes prompt, completion, cached, total tokens and iterations by workflow stage; baseline-repair usage is included in task totals; task agents compact redundant accumulated history without imposing a token stop; successful and failed tasks remain comparable; regression coverage and quality gate pass. ### Notes Maintainer decision: max_tokens is not desired as a blocker. Optimize context economics and preserve outcomes as metrics. ### Close reason Provider usage is durable by stage, baseline repair is included, model-adaptive compaction is enabled without a token cap, and ai-sdk preserves partial/compaction usage. task check and fresh adversarial review pass. --- _Imported from beads `archie-core-n5sr` · GitHub #637 · type bug · priority P0 · created 2026-08-24 · closed 2026-08-24_
sam added the criticalbug labels 2026-10-27 13:40:30 +00:00
sam self-assigned this 2026-10-27 13:40:30 +00:00
sam closed this issue 2026-10-27 13:40:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1464