Skip to content

agents: give --harness openhands a DigitalOcean Inference key and a DO model by default - #2058

Merged
Spherrrical merged 1 commit into
digitalocean:mainfrom
sk09-dev:feat/agents-openhands-inference
Oct 19, 2026
Merged

Spherrrical merged 1 commit into
digitalocean:mainfrom
sk09-dev:feat/agents-openhands-inference

Conversation

@sk09-dev

Copy link
Copy Markdown
Contributor

An openhands session created by doctl could not talk to any model. Two things were missing, both found on the first preview smoke:

  • No inference key. harness-api mints the session's DigitalOcean Inference key only when the agents.yaml create carries ?manage_model_access_key=true. The other harnesses ask for the user's own vendor key, so doctl never sent it.
  • No model. Without HARNESS_INFERENCE_MODEL the adapter falls back to the agent-server's gpt-5.5, which is not a DO catalogue id, so the gateway answered "model not found".

Now a manifest whose agent is openhands (from --harness or a --spec file) is created with the opt-in, a BYO --secret HARNESS_INFERENCE_API_KEY still wins, and --harness openhands writes env.HARNESS_INFERENCE_MODEL=openai-gpt-5.5 with a new --model flag to override it.

godo (through v1.229.0) has no field for manage_model_access_key, so the do layer builds that one request itself, mirroring godo's manifest create. To be folded into HostedAgentManifestCreateOptions when godo grows the field.

Verified live on the test environment: doctl harness-runtime create --harness openhands then exec env in the guest shows HARNESS_INFERENCE_API_KEY set, HARNESS_INFERENCE_MODEL=openai-gpt-5.5 and the platform base URL.

Tests: manifest builder (default, override, other harnesses), create goes through the managed-key path for --harness and for a --spec with agent: openhands, --model refused without --harness and on an existing session, and the do layer's request asserted on the wire with httptest.

…O model by default

An openhands session created by doctl could not talk to any model. Two things
were missing from what doctl sent, both found on the first preview smoke:

- No inference key. harness-api mints the session's DigitalOcean Inference key
  only when the agents.yaml create carries ?manage_model_access_key=true. The
  other harnesses never needed it (they ask for the user's own vendor key),
  so doctl never sent it, and the agent-server got an empty key.
- No model. Without HARNESS_INFERENCE_MODEL the adapter falls back to the
  agent-server's `gpt-5.5`, which is not a DigitalOcean catalogue id, so the
  gateway answered the first turn with "model not found".

Now: a manifest whose agent is openhands (from --harness or a --spec file) is
created through CreateSessionFromManifestWithManagedKey, which sends the
opt-in; a bring-your-own --secret HARNESS_INFERENCE_API_KEY=... still wins,
the server skips the mint for it. --harness openhands writes
env.HARNESS_INFERENCE_MODEL=openai-gpt-5.5, and a new --model flag overrides
it (and sets the model for any other --harness when given; it is refused
without --harness, where the manifest declares its own env).

godo (through v1.229.0) has no field for manage_model_access_key, so the do
layer builds that one request itself, mirroring godo's manifest create (same
path, application/x-yaml body, godo's own options kept). Fold it into
HostedAgentManifestCreateOptions when godo grows the field.

Tests: manifest builder (default, override, other harnesses, codex-agentapi's
existing env kept), create goes through the managed-key method for --harness
and for a --spec saying agent: openhands, --model without --harness refused,
--model rejected on an existing session like every other creation flag, and
the do layer's request asserted on the wire with an httptest server.
@Spherrrical
Spherrrical merged commit d74d475 into digitalocean:main Oct 19, 2026
9 checks passed
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

⌂ 换网址