Repository navigation
harness-runtime: opt into manage_model_access_key across the config/session create commands - #2114
Merged
Spherrrical merged 2 commits intoNov 9, 2026
Conversation
…ence shape Ask harness-api to mint HARNESS_INFERENCE_API_KEY on session and config create when the resolved manifest sets HARNESS_INFERENCE_MODEL without a harness or vendor API key, including durable Environment create. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Spherrrical
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harness Runtime Environments (configs) and YAML-backed session creates need to ask harness-api to mint a DigitalOcean Inference key when the agent will use serverless inference. That opt-in is
manage_model_access_key(config create JSON body field; session create query param).This change makes doctl set that flag implicitly from the resolved manifest, not from harness/adapter name:
HARNESS_INFERENCE_MODELis set (non-empty)HARNESS_INFERENCE_API_KEYOPENAI_API_KEYorANTHROPIC_API_KEYIf any of those vendor/harness keys are present (including via
--secret), doctl does not send the opt-in.--from-config/config start-sessionare unchanged: the Environment already fixed the key decision at create time.What changed
needsManagedModelAccessKeypredicate used by session create andconfig createCreateAgentConfigaccepts a manage-key bool and, when true, POSTs a hand-built body includingmanage_model_access_key: trueWhy not godo for that config create path
Vendored godo’s
HostedAgentConfigCreateRequestonly hasname+manifest_yaml— nomanage_model_access_keyfield yet. Sending an unknown field isn’t an option via the typed struct, so when the opt-in is needed we build the JSON and call/v2/harness-runtime/configsthrough the godo client’s request/Dopath (same pattern asCreateSessionFromManifestWithManagedKey, and similar to other doctl bypasses when godo lags, e.g. domains record port encoding / Functions namespaces). When the flag is false we still use the normal godoCreateAgentConfigcall.Test plan
Automated
do/wire tests that config create with manage-key sends"manage_model_access_key":trueand omits it when falseOPENAI_API_KEYskipping managed key)make build,gofmt_check,shellcheck,check_focusedgo testfor ManagedKey / AgentConfigCreate / Hermes / OpenHandsLive (
ui-open-harness-team,./builds/doctl)config createand sessioncreateacross harnesses (openhands,hermes,opencode+--model,claude-code,codex) × providers (DO SI / BYOKHARNESS_INFERENCE_API_KEY/ OpenAI / Anthropic)config get -o json:credentials/manifest.secretsincludeHARNESS_INFERENCE_API_KEYwhen expected, and omit it for vendor-key casesOPENAI_API_KEY/ANTHROPIC_API_KEYcreate --from-configon a DO-SI Environment inherits the minted key slotmak-*sessions/configs afterward