[AgentProfile][ts-client] Test ACP provider credential descriptors + re-sync claude-code set_session_model mirror#210
Conversation
…n_model mirror Part 2 of OpenHands/software-agent-sdk#3722 ([AgentProfile][ts-client]), the "ACP provider descriptor extension". The canvas ACP authentication section (sdk#3728) renders provider-specific credential forms from ACP_PROVIDERS' descriptor fields (api_key_env_var, base_url_env_var, file_secrets) instead of hardcoding provider lists. Those fields already exist on ACPProviderInfo and are populated for all three providers (landed with the registry mirror in #173/#187/#205), so the substantive ask is already met. This adds the missing unit test that locks the credential metadata in for each built-in provider. Also re-sync the one drifted field — claude-code supports_set_session_model (false -> true) — to match SDK main, which flipped it (#3654) after claude-agent-acp 0.30.0 was found to ignore session-_meta selection. The validate-acp-providers drift check was red on main until this. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
CI on The single red check is |
|
✅ Review complete. This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here. |
all-hands-bot
left a comment
There was a problem hiding this comment.
Code Review
🟢 Good taste — Clean, focused implementation with solid test coverage.
Summary
This PR adds comprehensive tests for the ACP provider credential descriptor fields (api_key_env_var, base_url_env_var, file_secrets) and fixes the supports_set_session_model value for claude-code from false to true.
Assessment
[CRITICAL ISSUES]
None.
[IMPROVEMENT OPPORTUNITIES]
- [src/tests/acp-providers.test.ts] Scope note: The PR title mentions "Extend ACPProviderInfo with credential descriptor fields" but the PR also changes
supports_set_session_modelfromfalsetotrueforclaude-code. This is a separate concern from the test coverage. Consider either:- Expanding the title to mention the
supports_set_session_modelfix, or - Moving this change to a separate PR focused on that fix
- Expanding the title to mention the
[STYLE NOTES]
None — tests are well-structured and follow the project's testing patterns.
[TESTING GAPS]
None — The tests provide good coverage:
- ✅ Verifies all three credential descriptor fields exist on every provider
- ✅ Tests specific env var values match expected values
- ✅ Verifies file secret structure for Codex and Gemini CLI
- ✅ Tests
getAcpProvider()function behavior including edge cases (null, undefined, unknown keys)
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
This is a low-risk change. The JSON modification updates a single boolean flag, and the test file adds validation that these fields exist and have correct values. The tests run and pass.
Verdict
✅ Worth merging: Core logic is sound, tests provide good coverage, tests pass.
Key Insight
The PR correctly validates that all built-in ACP providers expose the credential metadata that the canvas UI requires, and the supports_set_session_model fix ensures claude-code can set its model via the protocol call.
This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation
|
Thanks for the review! Addressed the scope note by expanding the title to call out the I kept it in this PR rather than splitting it out because the |
Why
Part of the AgentProfile epic (OpenHands/software-agent-sdk#3713), Phase 3 —
this is the "ACP provider descriptor extension" slice of
OpenHands/software-agent-sdk#3722. The canvas ACP authentication section
(sdk#3728) renders provider-specific credential forms by reading credential
metadata off
ACP_PROVIDERS(api_key_env_var,base_url_env_var,file_secrets) instead of hardcoding provider lists.Those descriptor fields already exist on
ACPProviderInfoand arepopulated for all three providers — they landed with the registry mirror
work (#173/#187/#205), which post-dates the issue text (the issue still
references the pre-mirror
src/utils/acp.ts; the registry now lives insrc/models/acp.ts). Their shape is a superset of the issue's request(
string | nullplus a richerfile_secretsmirroring the SDKfield-for-field), so changing them to optional
?: stringwould be aregression. The remaining gaps were: no test locking the metadata in,
and a drifted mirror field that left CI red on
main.Summary
src/__tests__/acp-providers.test.ts— asserts every built-inprovider (claude-code, codex, gemini-cli) exposes
api_key_env_var,base_url_env_var, andfile_secrets, checks each provider's expectedenv-var values and file-secret descriptors, and covers
getAcpProvider(known key,
custom, unknown, and falsy inputs).supports_set_session_modelfalse → trueto match SDKmain, whichflipped it (sdk#3654) after claude-agent-acp 0.30.0 was found to ignore
session-
_metamodel selection. Thevalidate-acp-providersdrift checkwas red on
mainuntil this.Issue Number
OpenHands/software-agent-sdk#3722 (epic OpenHands/software-agent-sdk#3713)
How to Test
Locally, against SDK
main(what CI'svalidate-acp-providerspins to):Type
Notes
ACPProviderInfoalready carried the credential fields; this only adds test coverage and a
one-line mirror re-sync.
securityjob (npm audit) is failing onmaintoo — pre-existingtransitive-dependency advisories (jest/babel/
ws); this PR touches neitherpackage.jsonnorpackage-lock.json.🤖 Generated with Claude Code