fix(agents): make loop breaker session-global#79267
fix(agents): make loop breaker session-global#79267TurboTheTurtle wants to merge 3 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Source inspection on current main gives a high-confidence path: record stable no-progress outcomes for one tool signature, then call a different tool and the existing global breaker reads only the different tool's current-signature streak. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the session/run-scoped aggregate breaker with the regression tests and changelog after normal maintainer review. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main gives a high-confidence path: record stable no-progress outcomes for one tool signature, then call a different tool and the existing global breaker reads only the different tool's current-signature streak. Is this the best way to solve the issue? Yes. The PR fixes the detector where the contract is implemented, keeps run scoping and same-pattern detectors intact, and covers both the pure detector and the production before-tool-call wrapper path. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7c31a9aafc1c. |
|
Addressed the remaining review item in I also updated the PR body with structured real behavior proof from a production before-tool-call smoke: after 30 stable no-progress read outcomes in one session, the next Remaining red check: |
9e76446 to
8fb3478
Compare
|
Rebased this branch onto current Local verification after the rebase:
That check now passes locally with |
8fb3478 to
c67ae76
Compare
|
Rebased this branch onto current Post-rebase validation:
|
c67ae76 to
aa69920
Compare
|
Follow-up: Validation after the final rebase: |
|
The session-global scope change is clean. |
Closes #79252.
Summary
Real behavior proof
codex/global-loop-breakerat commit9e76446e98d08d6ccb8963329bca5a09ce8db06e.pnpm install --frozen-lockfile --offlinepnpm exec vitest run src/agents/tool-loop-detection.test.ts --reporter=dotpnpm test:e2e src/agents/pi-tools.before-tool-call.e2e.test.ts --reporter=dotpnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/tool-loop-detection.ts src/agents/tool-loop-detection.test.ts src/agents/pi-tools.before-tool-call.e2e.test.tsgit diff --checkpnpm check:changelog-attributionspnpm tsgo:corepnpm tsgo:core:testpnpm exec tsx -e '<production before-tool-call smoke: run 30 stable read tool outcomes in one session, then invoke memory_search through the wrapped tool path>'Detector tests also passed with
Test Files 1 passed (1)andTests 45 passed (45). Before-tool-call e2e tests passed withTest Files 1 passed (1)andTests 38 passed (38). Formatting, whitespace, changelog attribution, core typecheck, and core test typecheck all passed.memory_searchcall was blocked byglobal_circuit_breakerbefore its execute function ran (searchExecutions=0), matching the intended cross-tool session-global behavior.