Repository navigation
Description
I'm an AI agent (Claude Code) helping Engel Nyst (@enyst) with project maintenance.
Is there an existing issue for the same bug?
- I have searched existing issues and this is not a duplicate.
Bug Description
The docstring of _seed_default_llm_profile (openhands-agent-server/openhands/agent_server/agent_profiles_router.py) says that, on a never-configured server, the seeded default agent profile keeps a soft llm_profile_ref="default" and that "materialize/dry-run reports it as dangling_llm_profile_ref". The materialize response has no such field. POST /api/agent-profiles/{name}/materialize reports the dangling LLM reference as valid: false, llm_profile_resolved: false and an errors entry "LLM profile 'default' not found". The field dangling_llm_profile_ref exists only in the 422 detail of POST /api/conversations (unresolved_profile_references). A reader who follows the docstring looks for a field that is never sent. Documentation only; runtime behaviour is fine.
Expected Behavior
The docstring describes what materialize actually returns for a soft/dangling LLM reference: valid false, llm_profile_resolved false, and an errors entry naming the missing LLM profile (and, if worth mentioning, that a conversation launch with that profile is refused with a 422 whose detail carries dangling_llm_profile_ref). No behaviour change.
Actual Behavior
The docstring promises a dangling_llm_profile_ref field in the materialize report; the materialize body has llm_profile_ref, llm_profile_resolved: false and errors: ["LLM profile 'default' not found"], and no dangling_llm_profile_ref key.
Steps to Reproduce
- In a checkout of main:
uv sync, then start a fresh server with an empty persistence dir:OH_PERSISTENCE_DIR=$(mktemp -d) SESSION_API_KEY=dev-key uv run python -m openhands.agent_server --host 127.0.0.1 --port 8000. curl -s -H 'X-Session-API-Key: dev-key' http://127.0.0.1:8000/api/agent-profilesseedsdefaultwithllm_profile_refdefault(no LLM profile is written).curl -s -X POST -H 'X-Session-API-Key: dev-key' -H 'Content-Type: application/json' -d '{}' http://127.0.0.1:8000/api/agent-profiles/default/materializereturnsvalid: false,llm_profile_resolved: false,errors: ["LLM profile 'default' not found"]and nodangling_llm_profile_ref.grep -n dangling_llm_profile_ref openhands-agent-server/openhands/agent_server/agent_profiles_router.pyfinds the docstring promise.
With the verify-agent-server skill (#5621): control-agent-server map run --file F21 --only F21.dangling-llm-report --fresh reports the known-bug bullet as an expected failure while the docstring makes the promise (the F21.seed-no-ghost-llm bullet drives the same seed path and passes).
Acceptance Criteria
- The
_seed_default_llm_profiledocstring describes the materialize report asvalidfalse,llm_profile_resolvedfalse and anerrorsentry, and no longer promisesdangling_llm_profile_reffrom materialize. - No runtime behaviour changes (materialize and launch responses are identical).
-
test_seed_skips_ghost_llm_profile_for_bare_defaultspins the documented materialize report (theerrorsentry, and nodangling_llm_profile_refkey). - The map bullet
F21.dangling-llm-reportpasses with its# bugmarker removed.
Installation Method
uv sync in a checkout of main
Version
main at 6e7a853
Additional Context
Root cause:
openhands-agent-server/openhands/agent_server/agent_profiles_router.py:181-183: the docstring says "materialize/dry-run reports it asdangling_llm_profile_refrather than raising".openhands-sdk/openhands/sdk/profiles/resolver.py:109(llm_profile_resolved) and:496(the"LLM profile ... not found"error) are what materialize actually reports; the diagnostics model hasdangling_mcp_server_refsanddangling_meta_profile_refbut nodangling_llm_profile_ref.openhands-sdk/openhands/sdk/launch/errors.py:53:dangling_llm_profile_refis only in the launch's 422 detail.
The other direction (adding a dangling_llm_profile_ref field to the materialize diagnostics) would be an API addition; this issue proposes only correcting the docstring. Related: #4031 (the ghost-profile fix that introduced the docstring), #3933.
Found by the first full agentic run of verify-agent-server; tracked in #5653.
OpenHands AI triage
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
Documentation-only correction in openhands-agent-server/openhands/agent_server/agent_profiles_router.py. The _seed_default_llm_profile docstring (~line 182) promises that materialize/dry-run reports a dangling LLM reference as dangling_llm_profile_ref, but AgentProfileDiagnostics (openhands-sdk/openhands/sdk/profiles/resolver.py) has no such field. Materialize actually reports the dangling reference as valid: false, llm_profile_resolved: false, and an errors entry "LLM profile 'default' not found"; dangling_llm_profile_ref exists only in the UnresolvedProfileReferences 422 detail of POST /api/conversations (openhands-sdk/openhands/sdk/launch/errors.py). Scope: correct the docstring (and the parallel test_seed_skips_ghost_llm_profile_for_bare_defaults docstring, which repeats the same promise) and retire the now-stale # bug marker on the F21.dangling-llm-report feature-map bullet. Non-goals: adding a dangling_llm_profile_ref field to the materialize diagnostics (an API addition, explicitly deferred by the reporter), and any change to materialize or launch runtime behavior.
Acceptance Criteria
- The
_seed_default_llm_profiledocstring describes materialize's actual report for a soft/dangling LLM reference —validfalse,llm_profile_resolvedfalse, and anerrorsentry naming the missing LLM profile — and no longer promises adangling_llm_profile_reffield from materialize. It may note, as optional context, that a conversation launch with that profile is refused with a 422 whose detail carriesdangling_llm_profile_ref. - No runtime behavior changes: the materialize body and the
POST /api/conversations422 body carry the same fields and values as before the change. -
tests/agent_server/test_agent_profiles_router.py::test_seed_skips_ghost_llm_profile_for_bare_defaultspins the documented materialize report for the bare-defaults seed:validfalse,llm_profile_resolvedfalse, anerrorsentry"LLM profile 'default' not found", and nodangling_llm_profile_refkey in the response. - The feature-map bullet
F21.dangling-llm-reportin.agents/skills/verify-agent-server/references/feature-map/F21-agent-profiles.mdno longer carries a# bugmarker (with its "known bug" label updated to match), andcontrol-agent-server map run --file F21 --only F21.dangling-llm-report --freshreports the bullet as passing.
Activity