Repository navigation
Add a resolution judge on a saved resolution_judge LLM profile - #6962
Conversation
The judge asks narrow yes/no questions about a turn and code combines them into whether anything is left for the user. Its model is the saved LLM profile resolution_judge, created on first use as a copy of the conversation's own LLM, like oracle and cleanup. Co-authored-by: openhands <openhands@all-hands.dev> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ArwwJH94xGSYwfoyccT4E
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Agent-server conversation start benchmarkBase
How this is measuredEach create is a Canvas-shaped
A timing is flagged when the 95% CIs do not overlap and the medians differ by at least 50 ms, or when a row with at least 8 samples per side moves by at least 150 ms and 25%. A create stalled the server when its slowest |
The board no longer guesses from question marks or request words: a question card asks by construction, and otherwise the resolution judge says whether the reply waits on the user; the ask is the end of that reply. The judge runs on the saved resolution_judge LLM profile, created from the conversation's own LLM, instead of OH_RESOLUTION_* environment variables. Carries a copy of the judge split (resolution.py, #6962). Co-authored-by: openhands <openhands@all-hands.dev> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ArwwJH94xGSYwfoyccT4E
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Reviewed at head d0578d307115b08da554c3dd6c0b139d44156628 (matches the requested review). Scope gate passes: issue #6961 is open with ready-for-dev and proposes exactly this SDK-side judge; the design follows the existing saved-profile-by-convention pattern (cleanup_profile.py's cleanup name, no caller on main), which the PR description and the issue both acknowledge.
Verification performed on this head:
- Diff is +713 across two new files only:
openhands-sdk/openhands/sdk/conversation/resolution.pyandtests/sdk/conversation/test_resolution.py. No existing files touched, so no compatibility or migration surface changes. uv run pytest tests/sdk/conversation/test_resolution.py→ 22 passed locally; the fulltests/sdk/conversation/suite also passes (1085 passed).ruff checkandruff format --checkclean on both files.- The module satisfies the repo's LLM message-construction invariant:
LLMDecisionModel.sendplaces asystemmessage before the firstusermessage. - Secret handling stays on the documented path: profile creation goes through
LLMProfileStore.save(..., include_secrets=True, cipher=cipher)(the store owns redaction/encryption contexts), and the judge copy reuses the fallback LLM's credential fields rather than introducing a parallel redaction mechanism.FileNotFoundErroris the store's documented miss error, so the create-if-missing branch is correct. model_copy(update={"usage_id": RESOLUTION_JUDGE_PROFILE_NAME, "num_retries": 0})gives the judge its own metrics session (usage_id change triggersreset_metrics()) and avoids nested retry loops withDecisionModel's tenacity decorator — the effective behavior (60 s per attempt, 1 retry at the DecisionModel layer, 0 inside the LLM) matches the docstring.verdict_from_judgmentsthresholds and each owed branch (answer,review,decide,check,unfinished,unclear) are covered by the new parametrized tests, and_parse_llm_answersdegrades malformed LLM output to "no" rather than crashing, which is also tested.
No material correctness, security, or compatibility findings. The remaining in-progress CI runs at review time (integration-test, tools-tests, benchmark, cross-tests, docker image builds) cover surfaces this SDK-only module change does not touch; the relevant sdk-tests check already passed on this exact head.
✅ APPROVED
|
Generated by Claude Code |
…store Main gained two profile loads that pass the cipher per call: LocalConversation.add_model_router_route (#6835) and resolution_judge (#6962). The conversation's store and the server's store are bound to their cipher, so both now load and save without naming it. resolution_judge(cipher=...) was published in 1.63.0. It stays as a deprecated argument that binds the store, scheduled for removal in 1.70.0.
HUMAN:
AND, why is it env vars? We should use an LLM profile, just like we have e.g. an 'oracle' profile, create it if it doesn't exist, 'resolution_judge', wdyt? and is it separable?
AGENT:
Why
Split out of #6602 (OpenHands Projects), which uses it to auto-resolve conversations. There it was configured by
OH_RESOLUTION_*environment variables; this version runs on a named LLM profile instead, likeoracleandcleanup. Likecleanup, it has no caller on main yet.Summary
openhands.sdk.conversation.resolution: the judge asks narrow yes/no questions about a turn (RESOLUTION_QUESTIONS) through anyDecisionModel.verdict_from_judgmentscombines them in code into aResolutionVerdict: resolved, or what the user still owes (answer,review,decide,check,unfinished,unclear).LLMDecisionModellets a chatLLManswer the same typed questions.resolution_judge(fallback, store, cipher=)loads the savedresolution_judgeprofile. If there is none, it first saves a copy offallback(the conversation's own LLM, with secrets, encrypted when a cipher is given). The judge keeps its own timeout and retries.Issue Number
Closes #6961
How to Test
uv run pytest tests/sdk/conversation/test_resolution.py: 22 passed, including two new profile tests (created from the conversation's LLM when missing; an existing profile wins).litellm_proxy/deepseek-v4.1-flashas the conversation LLM, empty profile store):Video/Screenshots
Not a visual change; output above.
Type
Notes
#6602 carries a copy of this module until it merges.
Generated by Claude Code
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdkpython-node-runtimepython-node-runtimepython-node-runtimegolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:ac30304-pythonRun
All tags pushed for this build
About Multi-Architecture Support
ac30304-python) is a multi-arch manifest supporting both amd64 and arm64ac30304-python-amd64) are also available if needed