Skip to content

fix(server): forward query string in sandbox proxy handler#266

Merged
Pangjiping merged 1 commit intoalibaba:mainfrom
wangdengshan:fix/proxy-query-string-forwarding
Feb 28, 2026
Merged

fix(server): forward query string in sandbox proxy handler#266
Pangjiping merged 1 commit intoalibaba:mainfrom
wangdengshan:fix/proxy-query-string-forwarding

Conversation

@wangdengshan
Copy link
Contributor

Summary

  • Forward the original query string when proxying requests to sandbox endpoints.
  • The proxy handler in server/src/api/lifecycle.py was constructing the target URL using only the path component (full_path), silently dropping the query string. This caused /files/download?path=... requests to reach the sandbox execd daemon without the path parameter, resulting in a 400 MISSING_QUERY error.

Testing

  • e2e / manual verification
    • Reproduced the error by calling sandbox.files.read_bytes() via the Python SDK with use_server_proxy=True
    • Confirmed fix by re-running the same scenario after patching; file download succeeded

Breaking Changes

  • None

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

The proxy handler was building the target URL using only the path
component (full_path), discarding the original query string. This caused
requests like /files/download?path=... to arrive at the sandbox execd
without the 'path' parameter, resulting in a 400 MISSING_QUERY error.

Fix by appending request.url.query to the target URL when present.
@CLAassistant
Copy link

CLAassistant commented Feb 28, 2026

CLA assistant check
All committers have signed the CLA.

@Pangjiping Pangjiping added bug Something isn't working component/server labels Feb 28, 2026
@Pangjiping
Copy link
Collaborator

also releated to #248

@alibaba alibaba deleted a comment from chatgpt-codex-connector bot Feb 28, 2026
Copy link
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Pangjiping Pangjiping merged commit c73832f into alibaba:main Feb 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants