Skip to content

S3Backend: tag boto3 user-agent and honor end_point_url without credentials#1271

Open
goanpeca wants to merge 1 commit into
OpenGVLab:mainfrom
goanpeca:b2-s3backend-support
Open

S3Backend: tag boto3 user-agent and honor end_point_url without credentials#1271
goanpeca wants to merge 1 commit into
OpenGVLab:mainfrom
goanpeca:b2-s3backend-support

Conversation

@goanpeca
Copy link
Copy Markdown

Summary

Three changes to S3Backend in internvl_chat_gpt_oss/internvl/utils/s3_fileio.py:

  1. Add user_agent_extra="internvl-chat-gpt-oss" to the botocore.Config so InternVL TCS traffic is identifiable in server-side logs of any S3 provider (AWS, Backblaze B2, Ceph RGW, Cloudflare R2, CoreWeave, MinIO, etc.).

  2. Fix end_point_url being silently dropped in the no-credentials path. The original else-branch built boto3.client('s3') with no endpoint and no Config, so a petreloss.conf cluster with endpoint_url but no access_key (relying on boto3's default credential chain such as env vars or an IAM role) was silently routed to AWS S3 instead of the configured cluster.

  3. Collapse the if/else into a single boto3.client(...) call. With both branches now passing the same endpoint_url and Config, the only difference was the credential args, which boto3 treats as no-ops when None.

Also a one-line docstring update listing common S3-compatible providers, and the bachendbackend typo fix.

Test plan

No test directory exists in the repo, so verified manually for the four call shapes (no / with end_point_url, no / with credentials). In every case the boto3 client carries user_agent_extra="internvl-chat-gpt-oss", read_timeout=5, connect_timeout=2, and the correct endpoint URL.

No new runtime dependencies.

Copilot AI review requested due to automatic review settings May 27, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant