Skip to content

fix(sdk): mark iterative refinement as critical setting#3115

Merged
xingyaoww merged 1 commit into
mainfrom
codex/iterative-refinement-critical
May 8, 2026
Merged

fix(sdk): mark iterative refinement as critical setting#3115
xingyaoww merged 1 commit into
mainfrom
codex/iterative-refinement-critical

Conversation

@xingyaoww
Copy link
Copy Markdown
Collaborator

@xingyaoww xingyaoww commented May 8, 2026

Summary

  • Mark verification.enable_iterative_refinement as a critical SDK setting so clients render it in Basic settings next to Enable Critic once its dependency is enabled.
  • Add a schema export assertion covering the prominence.

Context

This replaces the frontend-only workaround that was reverted from OpenHands/OpenHands#14133. The frontend can now pick up the intended Basic visibility directly from the SDK schema after the SDK is bumped in OpenHands.

Validation

  • make build
  • uv run pytest tests/sdk/test_settings.py -k "agent_settings_export_schema or iterative_refinement"
  • uv run pre-commit run --files openhands-sdk/openhands/sdk/settings/model.py tests/sdk/test_settings.py

Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22-slim Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:6560d50-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-6560d50-python \
  ghcr.io/openhands/agent-server:6560d50-python

All tags pushed for this build

ghcr.io/openhands/agent-server:6560d50-golang-amd64
ghcr.io/openhands/agent-server:6560d50-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:6560d50-golang-arm64
ghcr.io/openhands/agent-server:6560d50-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:6560d50-java-amd64
ghcr.io/openhands/agent-server:6560d50-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:6560d50-java-arm64
ghcr.io/openhands/agent-server:6560d50-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:6560d50-python-amd64
ghcr.io/openhands/agent-server:6560d50-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-amd64
ghcr.io/openhands/agent-server:6560d50-python-arm64
ghcr.io/openhands/agent-server:6560d50-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-arm64
ghcr.io/openhands/agent-server:6560d50-golang
ghcr.io/openhands/agent-server:6560d50-java
ghcr.io/openhands/agent-server:6560d50-python

About Multi-Architecture Support

  • Each variant tag (e.g., 6560d50-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 6560d50-python-amd64) are also available if needed

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Python API breakage checks — ✅ PASSED

Result:PASSED

Action log

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

REST API breakage checks (OpenAPI) — ✅ PASSED

Result:PASSED

Action log

@xingyaoww xingyaoww marked this pull request as ready for review May 8, 2026 01:23
@xingyaoww xingyaoww enabled auto-merge (squash) May 8, 2026 01:23
Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Clean change that properly marks iterative refinement as a critical setting for UI presentation. The test coverage ensures the prominence is correctly set.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-sdk/openhands/sdk/settings
   model.py5144990%268, 270, 282, 284, 339, 349–352, 355, 368, 372, 378, 388, 394, 399, 575, 588, 599, 609, 613, 615, 617, 619, 621, 623, 625, 840, 842, 1114, 1182, 1298, 1334–1337, 1363, 1487, 1532, 1564, 1574, 1576, 1581, 1599, 1612, 1614, 1616, 1618, 1625
TOTAL25469722471% 

@xingyaoww xingyaoww merged commit 62746aa into main May 8, 2026
35 checks passed
@xingyaoww xingyaoww deleted the codex/iterative-refinement-critical branch May 8, 2026 01:25
Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ QA Report: PASS

Verified that verification.enable_iterative_refinement is correctly marked as CRITICAL in the exported SDK schema, enabling frontend clients to render it in Basic settings.

Does this PR achieve its stated goal?

Yes. The PR successfully marks verification.enable_iterative_refinement as a CRITICAL SDK setting. Before this change, the field had SettingProminence.MINOR prominence. After this change, it has SettingProminence.CRITICAL prominence, which will enable frontend clients to render it in the Basic settings section alongside "Enable Critic" once the SDK is bumped in OpenHands.

The change is minimal, surgical, and exactly targets the stated goal of replacing the frontend-only workaround from OpenHands/OpenHands#14133.

Phase Result
Environment Setup make build succeeded, dependencies installed
CI Status ✅ All checks passing (pre-commit, tests, API checks, etc.)
Functional Verification ✅ Schema exports CRITICAL prominence; tests pass; pre-commit clean
Functional Verification

Test 1: Schema Prominence Change (Before/After)

Step 1 — Establish baseline (main branch without the fix):

Checked out origin/main and queried the exported schema:

uv run python -c "
from openhands.sdk.settings.model import AgentSettings
schema = AgentSettings.export_schema()
sections = {s.key: s for s in schema.sections}
v_fields = {f.key: f for f in sections['verification'].fields}
iterative_field = v_fields['verification.enable_iterative_refinement']
print(f'Prominence: {iterative_field.prominence}')
"

Output:

Prominence: SettingProminence.MINOR

Interpretation: On the main branch, enable_iterative_refinement has MINOR prominence, meaning it would be hidden in Advanced settings in the frontend.

Step 2 — Apply the PR's changes:

Checked out the PR branch codex/iterative-refinement-critical.

Step 3 — Re-run with the fix in place:

Re-ran the same query:

uv run python -c "
from openhands.sdk.settings.model import AgentSettings, SettingProminence
schema = AgentSettings.export_schema()
sections = {s.key: s for s in schema.sections}
v_fields = {f.key: f for f in sections['verification'].fields}
iterative_field = v_fields['verification.enable_iterative_refinement']
print(f'Prominence: {iterative_field.prominence}')
print(f'Is CRITICAL: {iterative_field.prominence is SettingProminence.CRITICAL}')
"

Output:

Prominence: SettingProminence.CRITICAL
Is CRITICAL: True

Interpretation: The prominence is now CRITICAL, confirming the fix works. Frontend clients consuming the schema will see this field as a Basic setting.


Test 2: Verify CRITICAL Settings Grouping

Checked which settings in the verification section are CRITICAL:

uv run python -c "
from openhands.sdk.settings.model import AgentSettings, SettingProminence
schema = AgentSettings.export_schema()
sections = {s.key: s for s in schema.sections}
for field in sections['verification'].fields:
    if field.prominence is SettingProminence.CRITICAL:
        print(f'{field.key}: {field.label}')
        if field.depends_on:
            print(f'  Depends on: {field.depends_on}')
"

Output:

verification.critic_enabled: Enable critic
verification.enable_iterative_refinement: Enable iterative refinement
  Depends on: ['verification.critic_enabled']

Interpretation: The two CRITICAL settings in the verification section are now "Enable critic" and "Enable iterative refinement", with the latter correctly depending on the former. This matches the intended UX where both settings appear in Basic settings, with iterative refinement only enabled when critic is enabled.


Test 3: Unit Test Coverage

Ran the tests specified in the PR validation section:

uv run pytest tests/sdk/test_settings.py -k "agent_settings_export_schema or iterative_refinement" -v

Output:

collected 55 items / 52 deselected / 3 selected

tests/sdk/test_settings.py::test_llm_agent_settings_export_schema_groups_sections PASSED [ 33%]
tests/sdk/test_settings.py::test_acp_agent_settings_export_schema_has_acp_section PASSED [ 66%]
tests/sdk/test_settings.py::test_llm_create_agent_critic_with_iterative_refinement PASSED [100%]

3 passed, 52 deselected, 7 warnings in 0.05s

Interpretation: All tests pass, including the new assertion on lines 113-116 that explicitly verifies prominence is SettingProminence.CRITICAL.


Test 4: Code Quality (Pre-commit Hooks)

Ran pre-commit on the changed files:

uv run pre-commit run --files openhands-sdk/openhands/sdk/settings/model.py tests/sdk/test_settings.py

Output:

Format YAML files....................................(no files to check)Skipped
Ruff format..............................................................Passed
Ruff lint................................................................Passed
PEP8 style check (pycodestyle)...........................................Passed
Type check with pyright..................................................Passed
Check import dependency rules............................................Passed
Check Tool subclass registration.........................................Passed

Interpretation: All pre-commit hooks pass. The code change is clean, properly formatted, and type-safe.

Issues Found

None.


Summary: This PR delivers exactly what it promises: a one-line metadata change that elevates enable_iterative_refinement from MINOR to CRITICAL prominence, enabling frontend clients to surface it in Basic settings alongside its dependency, "Enable critic". The change is tested, clean, and ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants