Repository navigation
fix(conversation): size stuck scan window for configured thresholds - #6238
Draft
yuhengcai1 wants to merge 2 commits into
Draft
yuhengcai1 wants to merge 2 commits into
yuhengcai1 wants to merge 2 commits into
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
1 of 2 tasks
Contributor
|
This was referenced Oct 26, 2026
1 of 5 tasks
1 of 5 tasks
Count parallel error history from the configured threshold window and opt the native regression into ThinkTool after the upstream default change. Co-authored-by: openhands <openhands@all-hands.dev>
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.
HUMAN:
AGENT:
Why
Valid custom stuck-detection thresholds can silently disable their detector when the bounded scan cannot hold the required history. An action-observation threshold of 12 requires 24 events. Large alternating-pattern, error-recovery, and monologue thresholds have the same problem.
The current main also widens error history for parallel tool calls (#6278). Both changes must compose: with an action-error threshold of 12 and two failing calls per response, 13 responses plus the corrective nudge require 53 events. Adding the parallel increment to the old 20-event base only provides 46.
Summary
Size the bounded active-branch scan from the configured thresholds, including the extra error response and nudge and the corrective messages accompanying monologues. Use the configured error window as the base for upstream's parallel-call expansion. The default base remains 20 events.
The merge preserves #6278's validation-error matching and response-counted error streaks. Native regressions explicitly opt into ThinkTool because current main no longer includes it by default.
Companion documentation: OpenHands/docs#1010 (matching branch).
Issue Number
No existing issue found for this configuration limit. This follows the bounded-history optimization in #1829 and is independent of #6235, #6236, and #6237.
How to Test
Verified against main
c048a1eb82353b0586f3ce600708394a68ebb246:git diff --checkpass.Repeated-success and alternating runs stop at 12 calls. The single-call error run emits one nudge after failure 11 and stops at failure 12. The parallel run emits one nudge after 12 responses (24 errors) and stops after response 13 (26 errors). The monologue run stops after 12 empty assistant responses, accounting for accompanying environment messages. Below-threshold runs and new-user-message resets remain valid.
Environment: macOS arm64, Python 3.13.17, committed uv lock. Only model responses are scripted with TestLLM; Agent, ThinkTool execution/validation, event creation, and Conversation.run() are real. No paid inference or model-behavior benchmark was run. The scan remains a bounded heuristic; this does not promise arbitrary-history or arbitrary-period loop detection.
Video/Screenshots
Non-visual change; native before/after results are above.
Design Doc
Small bounded-window correction; no separate design document.
Type
Notes
Larger configured thresholds inspect proportionally more history. Public defaults, event serialization, and upstream matching rules remain unchanged. The TypeScript implementation already scans the full post-user history and does not have this fixed-window limit.
The HUMAN section is reserved for the contributor. The agent-behavior evaluation requires the
integration-testlabel; no real-model benchmark was run locally.