Skip to content

[Bug]: _seed_default_llm_profile docstring says materialize reports dangling_llm_profile_ref, but the materialize response has no such field #5871

Closed

Description

@enyst

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

  1. 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.
  2. curl -s -H 'X-Session-API-Key: dev-key' http://127.0.0.1:8000/api/agent-profiles seeds default with llm_profile_ref default (no LLM profile is written).
  3. 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/materialize returns valid: false, llm_profile_resolved: false, errors: ["LLM profile 'default' not found"] and no dangling_llm_profile_ref.
  4. grep -n dangling_llm_profile_ref openhands-agent-server/openhands/agent_server/agent_profiles_router.py finds 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_profile docstring describes the materialize report as valid false, llm_profile_resolved false and an errors entry, and no longer promises dangling_llm_profile_ref from materialize.
  • No runtime behaviour changes (materialize and launch responses are identical).
  • test_seed_skips_ghost_llm_profile_for_bare_defaults pins the documented materialize report (the errors entry, and no dangling_llm_profile_ref key).
  • The map bullet F21.dangling-llm-report passes with its # bug marker 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 as dangling_llm_profile_ref rather 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 has dangling_mcp_server_refs and dangling_meta_profile_ref but no dangling_llm_profile_ref.
  • openhands-sdk/openhands/sdk/launch/errors.py:53: dangling_llm_profile_ref is 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_profile docstring describes materialize's actual report for a soft/dangling LLM reference — valid false, llm_profile_resolved false, and an errors entry naming the missing LLM profile — and no longer promises a dangling_llm_profile_ref field from materialize. It may note, as optional context, that a conversation launch with that profile is refused with a 422 whose detail carries dangling_llm_profile_ref.
  • No runtime behavior changes: the materialize body and the POST /api/conversations 422 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_defaults pins the documented materialize report for the bare-defaults seed: valid false, llm_profile_resolved false, an errors entry "LLM profile 'default' not found", and no dangling_llm_profile_ref key in the response.
  • The feature-map bullet F21.dangling-llm-report in .agents/skills/verify-agent-server/references/feature-map/F21-agent-profiles.md no longer carries a # bug marker (with its "known bug" label updated to match), and control-agent-server map run --file F21 --only F21.dangling-llm-report --fresh reports the bullet as passing.

Activity

  1. added
    bug
    ready-for-dev
    on Oct 14, 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

    bugready-for-dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions