feat(acp): connectivity test for managed API key credentials - #1013
Draft
ChrAlpha wants to merge 6 commits into
Draft
feat(acp): connectivity test for managed API key credentials#1013ChrAlpha wants to merge 6 commits into
ChrAlpha wants to merge 6 commits into
Conversation
Member
Author
|
Live E2E pass against a real Anthropic-compatible proxy (valid key + custom base URL), exercising Observed feedback after the fix (backend message → what the settings row renders):
The UI strings were pinned by running the raw backend messages through |
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.
Why
Model providers have a connectivity test, but ACP API-key setups (Codex, Claude Code) had none: a mistyped or revoked key, or a broken custom base URL, only surfaced at chat time as the opaque
acp_runtime_start_failed— the ACP settings green dot merely means "form fields filled". A spawn+initialize probe would not help here either, since adapters validate credentials lazily on the first model call; the honest cheap check is to validate the stored key directly against the provider endpoint.What
profile.APIKeyProbeTarget(internal/agent/runtime/acp/profile/credential_probe.go) resolves the probe target from the agent's managed config, mirroring what the runtime materializes: Codex →openai-responses@https://api.openai.com/v1(config.toml useswire_api = "responses"), Claude Code →anthropic-messages@https://api.anthropic.com;base_urloverrides apply. OAuth/self modes, missing keys, and unsupported agents return sentinel errors.providers.TestSDKProviderextracts the existing provider-probe classification (including the__ping__sentinel that catches auth failures behind unauthenticated/modelslistings) into a reusable function;providers.Service.Testnow delegates to it, behavior unchanged.POST /bots/{bot_id}/acp/agents/{agent_id}/credentials/test(internal/handlers/acp_credentials.go) gates onAuthorizeBotAccess, probes the saved managed credentials, and returns the same{status, reachable, latency_ms, message}shape as the provider test. Swagger + SDK regenerated.provider-form.vuemoved to a sharedutils/probe-error.ts(now unit-tested) and both call sites use it.allowBuildsplaceholder (protobufjs: set this to true or false→false) that made every freshpnpm installexit non-zero and blockedsdk-generate.Out of scope (discussed, follow-ups):
selfmode needs an end-to-end micro-turn probe; Hermes custom provider is not covered.Verification
go test ./internal/handlers/ ./internal/providers/ ./internal/agent/runtime/acp/profile/ ./internal/arch/— all pass (17 new test cases, written test-first against httptest fakes).go build ./cmd/... ./internal/...,golangci-lintclean on the touched packages.pnpm vitest run— 1118 passed; the 5 failures are pre-existing on main (verified identical with this branch's changes stashed).