fix: send a key saved for a vLLM, Ollama or custom profile - #34
Merged
Merged
Conversation
These kinds authenticate nothing by default, and every agent builder skips the key when a profile's auth is `none`. So `alc config key` on such a profile saved a key that no launch ever sent, while `alc config show` still listed it as saved-local. A vLLM or llama.cpp server started with an API key answered every launch with 401: opencode reported "Invalid API Key", codex a 401. A launch now treats a keyless-kind profile that has a key - saved, or read from its `api_key_env` - as bearer auth. It happens once, in `launch::build`, so all eight agent builders pick it up unchanged, and a profile without a key launches exactly as before. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015XwcLmZZ3eNrULtYBatTtZ
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
A vLLM, Ollama or custom profile with a saved key launched without it. These kinds default to
auth = none, and every agent builder skips the key in that case, soalc config key <profile>stored a key that no launch sent - whilealc config showstill reported it assaved-local. Against a server started with an API key (vLLM or llama.cpp--api-key),alc -p <profile> opencodefailed with "Invalid API Key" andalc -p <profile> codexwith a 401.launch::buildnow treats a keyless-kind profile that has a key - saved, or read from itsapi_key_env- as bearer auth.Validation
a_key_saved_for_a_vllm_profile_is_sentfails on the previous implementation (noapiKeyin the injected OpenCode config, noenv_keyfor Codex) and passes with the fix;a_vllm_profile_without_a_key_still_sends_noneguards the unchanged path.cargo fmt -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-targets --all-features: 605 unit tests + 67 integration tests passed locally on macOS.ALC_CONFIG_DIRwith every key variable unset:alc -p brandy opencode runandalc -p brandy-codex codex execboth answered.Local checks used
DEVELOPER_DIR=/Library/Developer/CommandLineToolsbecause the default Xcode installation requires license acceptance; no system configuration was changed.Boundaries
No config schema change: a profile's stored
authstaysnone, and bearer applies per launch.alc config showandalc doctorare unchanged, since they already reported the key as saved. On released builds,alc config upsert <profile> --auth beareris the workaround.Found while testing against Qwen3.8 on llama.cpp, not addressed here:
model_reasoning_effort.maxis valid for GPT models, but Qwen3.8's chat template rejects it with HTTP 500, which Codex reports as "high demand". A profile-level--effort mediumavoids it.--protocol responses, OpenCode (@ai-sdk/openai) fails with "text part ... not found" against llama.cpp's streaming/v1/responses;--protocol chatworks.🤖 Generated with Claude Code
https://claude.ai/code/session_015XwcLmZZ3eNrULtYBatTtZ