feat(ai): detect consecutive redundant reads of unchanged files in tool-call loop guard - #902
Conversation
|
Important Review skippedToo many files! This PR contains 132 files, which is 32 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (132)
You can disable this status message by setting the 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 |
…ompaction # Conflicts: # docs/handbook/book/404.html # docs/handbook/book/acknowledgements.html # docs/handbook/book/appendix/glossary.html # docs/handbook/book/architecture/compaction.html # docs/handbook/book/architecture/config.html # docs/handbook/book/architecture/mcp.html # docs/handbook/book/architecture/memory.html # docs/handbook/book/architecture/overview.html # docs/handbook/book/architecture/providers.html # docs/handbook/book/architecture/sandbox.html # docs/handbook/book/architecture/secrets.html # docs/handbook/book/architecture/session-turn.html # docs/handbook/book/architecture/tui.html # docs/handbook/book/concepts/index.html # docs/handbook/book/concepts/model-contract.html # docs/handbook/book/concepts/permission-model.html # docs/handbook/book/concepts/sessions-turns-threads.html # docs/handbook/book/context/compaction-memory.html # docs/handbook/book/context/context-files.html # docs/handbook/book/context/goal-state.html # docs/handbook/book/context/reads-search.html # docs/handbook/book/edit/edit-repair.html # docs/handbook/book/edit/engine.html # docs/handbook/book/edit/roadmap.html # docs/handbook/book/features/advisor.html # docs/handbook/book/features/branching.html # docs/handbook/book/features/cockpit.html # docs/handbook/book/features/collab.html # docs/handbook/book/features/connectors.html # docs/handbook/book/features/cpu-limit.html # docs/handbook/book/features/doctor.html # docs/handbook/book/features/exec.html # docs/handbook/book/features/export-import.html # docs/handbook/book/features/extensions-authoring.html # docs/handbook/book/features/extensions.html # docs/handbook/book/features/feature-flags.html # docs/handbook/book/features/hooks-authoring.html # docs/handbook/book/features/hooks.html # docs/handbook/book/features/index.html # docs/handbook/book/features/keybindings.html # docs/handbook/book/features/lsp.html # docs/handbook/book/features/marketplace-authoring.html # docs/handbook/book/features/marketplace.html # docs/handbook/book/features/mcp.html # docs/handbook/book/features/memory.html # docs/handbook/book/features/personalities.html # docs/handbook/book/features/plan-mode.html # docs/handbook/book/features/plugins.html # docs/handbook/book/features/profiles.html # docs/handbook/book/features/python-repl.html # docs/handbook/book/features/review.html # docs/handbook/book/features/sandbox.html # docs/handbook/book/features/secrets.html # docs/handbook/book/features/skills-authoring.html # docs/handbook/book/features/skills.html # docs/handbook/book/features/speech.html # docs/handbook/book/features/subagents.html # docs/handbook/book/features/web-search.html # docs/handbook/book/foundations/architecture.html # docs/handbook/book/foundations/thesis.html # docs/handbook/book/foundations/verification.html # docs/handbook/book/index.html # docs/handbook/book/introduction.html # docs/handbook/book/models/prompts.html # docs/handbook/book/models/providers.html # docs/handbook/book/models/system-prompt.html # docs/handbook/book/observability/overview.html # docs/handbook/book/print.html # docs/handbook/book/reference/approval-mode.html # docs/handbook/book/reference/cli.html # docs/handbook/book/reference/environment-complete.html # docs/handbook/book/reference/environment.html # docs/handbook/book/reference/exit-codes.html # docs/handbook/book/reference/file-locations.html # docs/handbook/book/reference/hooks.html # docs/handbook/book/reference/index.html # docs/handbook/book/reference/keybindings-config.html # docs/handbook/book/reference/keybindings-ref.html # docs/handbook/book/reference/mcp-config.html # docs/handbook/book/reference/models-yml.html # docs/handbook/book/reference/project-trust.html # docs/handbook/book/reference/providers.html # docs/handbook/book/reference/rpc.html # docs/handbook/book/reference/sdk.html # docs/handbook/book/reference/settings-reference.html # docs/handbook/book/reference/settings.html # docs/handbook/book/reference/skills.html # docs/handbook/book/reference/slash-commands.html # docs/handbook/book/reference/theme.html # docs/handbook/book/reference/tools.html # docs/handbook/book/reference/tree-command.html # docs/handbook/book/repair/cascade.html # docs/handbook/book/repair/overview.html # docs/handbook/book/repair/per-model.html # docs/handbook/book/repair/soundness.html # docs/handbook/book/router/role-routing.html # docs/handbook/book/searcher-c2a407aa.js # docs/handbook/book/searchindex-858018f9.js # docs/handbook/book/using/authentication.html # docs/handbook/book/using/configuration.html # docs/handbook/book/using/configuring-providers.html # docs/handbook/book/using/custom-tools.html # docs/handbook/book/using/editing.html # docs/handbook/book/using/examples.html # docs/handbook/book/using/extending.html # docs/handbook/book/using/faq.html # docs/handbook/book/using/getting-started.html # docs/handbook/book/using/install.html # docs/handbook/book/using/mcp-setup.html # docs/handbook/book/using/migration-guide.html # docs/handbook/book/using/models.html # docs/handbook/book/using/quickstart.html # docs/handbook/book/using/roles-and-profiles.html # docs/handbook/book/using/safety.html # docs/handbook/book/using/sessions.html # docs/handbook/book/using/task-guides.html # docs/handbook/book/using/themes.html # docs/handbook/book/using/troubleshooting.html # docs/handbook/book/why/argot.html # docs/handbook/book/why/index.html # docs/handbook/book/why/innovations.html # docs/handbook/book/why/performance.html # docs/handbook/book/why/value.html
Adding read subsumption rewrote the threshold check from `count !== threshold` to `count >= threshold`, so the redirect fired again on every repeat after the first. The turn-sim suite states the contract in its name and went red on both of its arms: one redirect, on the turn that reaches the threshold. The subsumption branch had the same shape and no test for it, so a steer for a redundant read repeated on every further read. Both branches fire on equality now, and the positive subsumption test carries a fourth still-subsumed read that must stay quiet. Refs #902
Summary
ToolCallLoopGuardin@veyyon/aito detect consecutive redundant/subsumedreadtool calls on unchanged files whose requested line ranges are already fully present in recent context.model.toolCallLoopGuard.readSubsumptionThreshold(default2).edit,write,ast_edit, orbash) and permits legitimate overlapping scrolls (1-50->40-100) and summary drill-downs without triggering the guard.Verification
packages/ai/test/tool-call-loop-guard.test.ts(10/10 tests passing, mutation-gated)packages/coding-agent/test/agent-session-tool-call-loop-guard.test.ts(2/2 tests passing, mutation-gated)bun run check:tools&bun run check:tsclean