Repository navigation
Conversation
Detects four loop patterns (error_retry / repeat / repeat_by_output / cycle) during ReAct tool execution and reacts via a configurable mode: - disabled (default): no behaviour change - warn: inject a system hint into react_memory and keep going - block / fallback: stop the ReAct loop and return loop_fallback_message New files: - oxygent/utils/loop_detector.py core detection + prompt builder - oxygent/utils/loop_signatures.py tool-level signature registry - tests/unittest/test_loop_detector.py 16 unit tests - examples/agents/demo_loop_detection.py end-to-end demo Modified: - oxygent/oxy/agents/react_agent.py +47 lines (2 Fields + detection hook) SkillAgent inherits from ReActAgent so it gets the feature for free. Default mode is disabled; existing users see no behaviour change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Add docs/loop_detection_feature.md (12-section feature spec covering problem statement, architecture, four detection patterns, three handling modes, two-layer signature mechanism, usage examples, design trade-offs and FAQ) - Add docs/loop_detection_test_report.md (comprehensive test report: 16 unit tests, 3-mode e2e smoke, Web UI real-request verification, 45-test targeted regression, 346-test full regression, performance comparison, risk analysis) - Remove 'fallback' mode (semantic duplicate of 'block'); loop_detection_mode now accepts only 'disabled' | 'warn' | 'block' - Tighten demo prompt so the LLM reliably triggers the search tool Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
error_retry/repeat/repeat_by_output/cycledisabled(默认,不改变现有行为)/warn(注入系统提示并继续)/block(终止 ReAct 循环并返回兜底消息)oxygent/utils/loop_detector.py、oxygent/utils/loop_signatures.py;react_agent.py仅 +46 行(2 个字段 + 检测钩子)docs/loop_detection_feature.md、docs/loop_detection_test_report.md与端到端 demoexamples/agents/demo_loop_detection.pyTest plan
tests/unittest/test_loop_detector.py16 条用例全部通过disabled,现有用户零感知🤖 Generated with Claude Code