Repository navigation
fix(conversation): retain custom stuck thresholds when forking - #6239
Draft
yuhengcai1 wants to merge 1 commit into
Draft
yuhengcai1 wants to merge 1 commit into
yuhengcai1 wants to merge 1 commit into
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
|
📁 PR Artifacts Notice This PR contains a |
This was referenced Oct 26, 2026
1 of 5 tasks
1 of 5 tasks
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
LocalConversation.fork()copies the stuck-detection enable flag but drops custom thresholds. A fork can therefore stop earlier or later than its source on the same sequence of model responses. For example, a source configured for six repeated observations stops at six, but its fork stops at the default four.Summary
Pass an independent copy of the source detector's threshold configuration into the fork constructor. Add native source/fork run-loop comparisons for lower and higher observation thresholds, error recovery, monologues, and alternating calls, plus default and disabled-detector controls.
This is based directly on main and independent of #6238's scan-window correction. Companion documentation: OpenHands/docs#1011.
Issue Number
No matching existing issue or PR identified for the forked threshold reset.
How to Test
On main
ce5716a3c0a955a85bb0cc4dcfaa94d5fefcda50, the new native suite has 5 failed, 2 passed. Each source run obeys its configured threshold, but each custom-threshold fork uses defaults. With this fix, all 42 tests in the command above pass, including 7 source/fork behavior comparisons. Applicable pre-commit formatting, lint, typing, and repository checks pass.The source and fork are created through the supported API with on-disk persistence and real event copying. Each receives the same bounded sequence through a stubbed
LLM.completionboundary backed byTestLLM; native Agent, ThinkTool execution/validation, andConversation.run()are exercised. Each script has seven responses plus a finish fallback. No paid inference or model-behavior benchmark was run.Environment: macOS arm64, Python 3.13.17, committed uv lock.
Video/Screenshots
Non-visual change; native source/fork counts are asserted by the regression tests.
Design Doc
Small constructor propagation fix; no separate design document.
Type
Notes
The fix applies to local SDK forks. Defaults, disabled detection, and public/serialized schemas are unchanged. Remote custom-threshold propagation is a separate path and is not claimed fixed here.
The HUMAN section remains for the contributor. A maintainer must apply
integration-test; this contributor account lacks permission to add labels.