Skip to content

Resolution judge: decide whether a turn leaves anything for the user #6961

Closed

Description

@enyst

Agents that run conversations for a user (for example OpenHands Projects, #6602) need to know when a turn leaves nothing for the user: no question to answer, no PR to review, no choice to make. That is a different question from the critic's "did the task succeed?".

Proposed, in the SDK:

  • A judge that asks a model narrow yes/no questions about the turn (via DecisionModel, already on main) and combines the answers in code into a verdict: resolved, or what the user still owes (answer, review, decide, check, ...).
  • Its model is a saved LLM profile named resolution_judge, resolved by convention like oracle and cleanup. If the profile does not exist, it is created on first use as a copy of the conversation's own LLM, so users can find it with their other profiles and point it at another model.
  • No environment-variable configuration and no text heuristics: the model decides.

OpenHands AI triage

The following comments and acceptance criteria were added by the OpenHands AI agent.

Triage

SDK-only feature following the repository's profile-by-convention precedents: openhands-sdk/openhands/sdk/llm/cleanup_profile.py (stateless standalone module whose model is a saved profile resolved by convention through LLMProfileStore) and the ask_oracle tool (profile looked up from the conversation's profile store). The judge asks typed yes/no (Noul) questions through DecisionModel (openhands-sdk/openhands/sdk/llm/decision.py, public on main) and combines the answers in code into a verdict.

Scope decisions taken from repository evidence and the issue's own stated choices:

  • The judge is a standalone SDK callable that a caller invokes after a turn with that turn's events; it is not auto-run by Conversation.run(), not an agent tool, and has no agent-server REST/WebSocket surface.
  • On first use with no saved profile, the judge creates the resolution_judge profile in LLMProfileStore as a copy of the conversation's own LLM. This is the issue's explicit product choice and intentionally differs from oracle (which surfaces an error when the profile is missing) and cleanup (which fails open and does nothing).
  • The initial set of owed categories is exactly the four named in the issue (answer, review, decide, check); extending the set later is a compatible addition and is not part of this work.
  • The issue defines no fail-open verdict, so when the decision call fails after DecisionModel retries, the mapped SDK LLM error propagates to the caller instead of returning a default verdict.

Non-goals: scoring whether the task succeeded (that stays with the critic); persisting judge results as events or in settings schemas; environment-variable configuration for the judge's model; text-pattern heuristics; consumption by OpenHands Projects (#6602) in OpenHands/OpenHands; changes to the agent server or clients/typescript/.

Acceptance Criteria

  • Calling the judge on a turn whose events leave nothing for the user (no question asked, no PR opened for review, no choice offered, no unverifiable result) returns the resolved verdict, verified by a test with a constructed event sequence.
  • For turns ending respectively with (a) a direct question to the user, (b) a PR or diff awaiting user review, (c) a choice the user must make, and (d) a result the agent could not verify itself, the judge returns answer, review, decide, and check; each case has its own test.
  • The verdict is computed in code from the typed DecisionResult answers, not from model-generated prose; a test asserts the mapping from answers to verdict.
  • The verdict is a serializable SDK type whose values are exactly resolved plus answer, review, decide, check in this cut, and it round-trips through model_dump/model_validate.
  • First use when no resolution_judge profile is saved creates one in LLMProfileStore as a copy of the conversation's own LLM: a test asserts LLMProfileStore.load("resolution_judge") afterwards returns a profile with the conversation LLM's model and connection configuration.
  • Once the profile exists, editing the saved resolution_judge profile changes the model the judge uses on its next call; a test asserts the judge uses the edited profile's model.
  • Profile creation and loading go through LLMProfileStore (including its cipher/secret handling); the judge introduces no environment-variable configuration and no text-pattern heuristics.
  • If the decision call fails after DecisionModel retries, the judge raises the mapped SDK LLM error rather than returning a default verdict; a test overrides DecisionModel.send to raise and asserts propagation.
  • Sync and async entry points both exist, matching the cleanup module convention.
  • Tests live under tests/sdk/ mirroring the new module path and pass with uv run pytest on the smallest relevant set.
  • Documentation for the new public API is added in the OpenHands/docs repository under sdk/, per the SDK documentation workflow, alongside the change.

Activity

  1. added
    ready-for-dev
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions