fix(workspace): X-Session-API-Key header missing on POST requests to agent-server#3584
Open
Dr1985 wants to merge 1 commit into
Open
fix(workspace): X-Session-API-Key header missing on POST requests to agent-server#3584Dr1985 wants to merge 1 commit into
Dr1985 wants to merge 1 commit into
Conversation
…T requests to agent-server
Member
|
Hey @Dr1985 thanks for the PR. However, i'm not sure this is the right place for the fix |
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.
HUMAN:
This PR will close issue #3574.
AGENT:
Why
RemoteWorkspaceMixin._headersonly returns{"X-Session-API-Key": api_key}when
api_keyis explicitly passed as a constructor argument. There is nofallback to the environment variables already used by the agent-server ecosystem
(
OH_SESSION_API_KEYS_0andSESSION_API_KEY).When a caller (e.g., the Web UI) creates
RemoteWorkspace(host=..., working_dir=...)without providing
api_key, every HTTP request from the SDK lacks the auth header.Summary
-When the OpenHands Web UI creates a
RemoteWorkspacewithout explicitly passingapi_key, theX-Session-API-Keyheader is never sent in HTTP requests to theagent-server. This causes 401 Unauthorized errors on all POST endpoints.
-GET requests may incidentally succeed because the agent-server's session API key
validation is only active when
OH_SESSION_API_KEYS_*environment variables areset (i.e.,
config.session_api_keysis non-empty). When the validator isactive, ALL
/api/*routes require the header regardless of HTTP method.Issue Number
Closes #3574
How to Test
All 122 workspace tests pass:
Video/Screenshots
Type
Notes