Repository navigation
Report detours that only some repetitions take - #330
Merged
Merged
Conversation
improve start now compares repetitions of each task. An attempt that took more model steps or tool calls than its typical repetition and used at least 25% more input tokens (runtime when tokens are unrecorded) gets a repetition_detour finding listing the extra calls and intermediate model steps. Interleaved controls are diagnosed the same way so the finding can be linked in intervention records. On the 18 retained Codex traces it flags exactly the three runs that took an extra model step. docs/CODEX.md now attributes those token spikes to the extra step rather than to an instruction-file read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AgentLoop replay self-testThis required repository check evaluates generated synthetic demo traces. It tests the replay and CI machinery; it does not show that this PR improves application performance. AgentLoop CI Report
Performance Gates
Trace inputsThis comparison includes synthetic data. It does not establish application performance gains from a pull request.
Metric Impact
Top Findings
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In the first Codex run, the costliest waste was a token spike of about 18–20k in some repetitions. AgentLoop's findings judge one trace at a time, so each spike looked normal on its own and nothing was reported.
Investigating it also corrected the diagnosis. Each spike came from an extra model step: Codex ran one tool, called the model again, then ran another tool, and every model step resends about 19k tokens of context. The
RTK.mdread previously blamed indocs/CODEX.mdcost nothing when it ran in the same step as the requested read.What
agentloop/repetitions.py: compares the repetitions of each task. An attempt gets arepetition_detourfinding when:plan.mdand can be selected with--focus repetition_detour;docs/CODEX.mdcorrection, a GUIDED_OPTIMIZATION section and CHANGELOG entries.Validation on real traces
Run against the 18 retained Codex traces (baseline, control, candidate):
It caught exactly the three spikes and nothing else. An earlier draft also flagged a slower baseline run that had no extra tokens. That is why tokens decide whenever they are recorded.
Tests
tests/test_repetitions.py(7):capture,startandplan.md.🤖 Generated with Claude Code