You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(sdk/go): stop sending empty args on AddResource (#2878)
AddResource unconditionally attached args: {} to every request body. Against
instances that predate #2549 (which added the args field to the resources
route under model_config=ConfigDict(extra="forbid")), the empty args object
is rejected with "body.args: Extra inputs are not permitted", so add-resource
fails entirely on older / hosted endpoints.
Only attach args when arguments were actually provided (len(opts.Args) > 0),
mirroring the Python SDK _compact_request_body (#2834) and the Rust CLI
compact_request_body (#2799). Other fields, including directly_upload_media,
are unchanged. Scope is args-only, matching #2834.
Tests cover the three arg states: omitted when unset, omitted when explicitly
empty (server defaults args to {} on this create route, so absent and
present-but-empty are equivalent), and forwarded when populated.