fix(agent-server): resolve linked providers for plaintext profile reads - #4952
fix(agent-server): resolve linked providers for plaintext profile reads#4952enyst wants to merge 2 commits into
Conversation
Return current linked credentials to runtime clients without changing stored profiles or default settings. Keep editor reads unresolved. Cover encrypted storage, rotation, and real HTTP profile selection with RemoteWorkspace. Co-authored-by: openhands <openhands@all-hands.dev>
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
|
@OpenHands /codereview this pr please and post your feedback as a comment. look at the linked pr too. do we really need to add a plaintext secrets? other options? why does it seemingly needed? |
|
I'm on it! enyst can track my progress at all-hands.dev |
|
🟢 Good taste I looked through this PR and the linked OpenHands/extensions#547 flow. I do not think this PR adds a new plaintext-secret capability: Why it is needed in the current design: a linked profile deliberately stores only There are alternatives, but none is a smaller fix:
The relevant trust boundary remains unchanged: The tests cover encrypted-at-rest provider credentials, key rotation, unchanged stored profiles/default settings, and a real HTTP path through [RISK ASSESSMENT]
This touches credential material, so the impact of a mistake is meaningful. The implementation itself is narrow, authenticated under the existing trust model, preserves redacted/encrypted editor reads, and adds no new secret-exposure mode. The two current failing checks appear unrelated: a timing-sensitive session-socket test and an expired deprecation elsewhere. VERDICT: KEY INSIGHT: This review comment was generated by an AI agent (OpenHands) on behalf of @enyst. |
|
Reviewed PR #4952 and linked OpenHands/extensions#547, then posted feedback here: Conclusion: the PR does not introduce plaintext exposure; it makes provider-linked profiles consistent with the existing authenticated Validation:
GitHub formal approval was not possible because the available token belongs to the PR author, so I posted the requested review as a PR comment. |
|
🚦 CI is currently failing on this PR's latest commit. Please fix the failing checks before OpenHands reviews it - this is re-checked automatically once you push a new commit. (A maintainer can also request This is an automated check - no AI was used to generate this comment. |
HUMAN:
This PR proposes an addition to assist PR 547 on extensions/ repo to show the LLM profile of an Automation.
AGENT:
I am an AI agent (smolpaws) acting on behalf of Engel.
Why
OpenHands/extensions#547 selects a named LLM profile and passes its configuration to a new conversation, but plaintext profile reads currently omit a linked provider's API key and base URL.
Summary
GET /api/profiles/{name}withX-Expose-Secrets: plaintext.RemoteWorkspace.get_llm(profile_name=...).Issue Number
Supports OpenHands/extensions#548 and OpenHands/automation#430.
How to Test
uv run pytest tests/agent_server/test_profiles_router.py -q uv run pytest tests/cross/test_remote_conversation_live_server.py -k 'workspace_named_llm_resolves_current_provider_credentials or workspace_default_llm_resolves_active_profile_despite_settings_drift' -q uv run pre-commit run --files openhands-agent-server/openhands/agent_server/profiles_router.py tests/agent_server/test_profiles_router.py tests/cross/test_remote_conversation_live_server.pyResults: 106 profile tests passed; both live-server tests passed; all applicable pre-commit hooks passed.
The live test starts Uvicorn, creates a provider and profile through HTTP, selects the profile through the SDK, rotates the provider key, and confirms the next selection uses that key while the active default is unchanged.
The existing shared-provider test failed on the original route because the plaintext API key was
None, then passed with this fix.Type
Notes
This dependency must reach the deployed Agent Server before the extensions#547 follow-up can run provider-linked profiles. No external LLM calls are used by these tests.
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22-slimnikolaik/python-nodejs:python3.13-nodejs22-slimgolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:edc90a4-pythonRun
All tags pushed for this build
About Multi-Architecture Support
edc90a4-python) is a multi-arch manifest supporting both amd64 and arm64edc90a4-python-amd64) are also available if needed