Repository navigation
fix: Accept the documented options on the top-level factories - #583
Merged
Merged
Conversation
razor-x
force-pushed
the
claude/ruby-sdk-audit-xbhaia-factory-options
branch
from
November 5, 2026 19:54
31d6dac to
8b70c83
Compare
The README shows Seam.from_api_key taking faraday_options and
faraday_retry_options, but Seam.from_api_key, Seam.from_personal_access_token,
and their Seam::Http counterparts forwarded only endpoint,
wait_for_action_attempt, and timeout, so the documented call raised
ArgumentError. The README also constructed a client with a positional
Seam.new("your-api-key"), which the keyword-only constructor rejects, and
claimed every timeout raises Faraday::TimeoutError while the spec named
for that assertion checked Faraday::ConnectionFailed.
Forward both options through every factory, fix the README example, and
document what actually happens: a connection that cannot be opened in
time raises Faraday::ConnectionFailed and a response that does not arrive
in time raises Faraday::TimeoutError, each now covered by a spec.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SQW83gyXeUG61RDrHEky97
razor-x
force-pushed
the
claude/ruby-sdk-audit-xbhaia-factory-options
branch
from
November 5, 2026 20:01
8b70c83 to
d8d6eaf
Compare
The other Seam SDKs take the api key as the first positional argument,
and the README showed Seam.new("your-api-key"), but every Ruby
constructor was keyword-only and raised ArgumentError on that call.
Accept the api key as the first argument to Seam.new, Seam::Http.new,
and Seam::Http::SingleWorkspace.new, and the personal access token as
the first argument to Seam::Http::WithoutWorkspace.new, with every other
option still passed by keyword. Giving the token both ways raises the
SDK's invalid options error.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SQW83gyXeUG61RDrHEky97
razor-x
force-pushed
the
claude/ruby-sdk-audit-xbhaia-factory-options
branch
from
November 5, 2026 20:39
d8d6eaf to
6f60a5a
Compare
razor-x
enabled auto-merge (squash)
November 5, 2026 20:42
razor-x
disabled auto-merge
November 5, 2026 20:42
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.
Problem
SDK audit finding L2, plus the positional constructor the other SDKs have:
Seam.from_api_key("...", faraday_options: {}, faraday_retry_options: {}), butSeam.from_api_key,Seam.from_personal_access_token, and theSeam::Httpcounterparts forwarded onlyendpoint,wait_for_action_attempt, andtimeout, so the documented call raisedArgumentError: unknown keywords.Seam.new("your-api-key"). The other SDKs accept the token as the first positional argument (pythonSeam("key", endpoint=...), JSnew SeamHttp("key"), PHPnew Seam("key")), but every Ruby constructor was keyword-only and raisedArgumentErroron it.Faraday::TimeoutError, while the spec named "raises Faraday::TimeoutError" assertedFaraday::ConnectionFailed.Fix
Two commits:
Faraday::ConnectionFailed(Net::OpenTimeoutis in itsNET_HTTP_EXCEPTIONS), a response that does not arrive in time raisesFaraday::TimeoutError.Seam.new,Seam::Http.new, andSeam::Http::SingleWorkspace.new, and the personal access token as the first positional argument toSeam::Http::WithoutWorkspace.new, following python's shape: first positional is the token, everything else stays keyword-only (client:included). Giving the token both ways raisesSeamInvalidOptionsError. The README keepsSeam.new("your-api-key")and shows the positional form in the authentication sections.Tests
spec/seam_client/factory_options_spec.rbcovers all four factories:faraday_optionsreaches the client's headers and request options, andfaraday_retry_options: {max: 0}is honored (one request on a 503, counted with WebMock).timeout_spec.rbrenames the mislabeled example and adds a read-timeout spec against a local socket that accepts but never responds, assertingFaraday::TimeoutError.api_key_spec.rbandclient_without_workspace_spec.rbcover the positional token on every constructor, the both-ways rejection, the positional token alongsideclient:, a nil first argument, and token-format rejection through the positional path.Revert-check against
main: 8ArgumentErrorfailures from the factory specs;Seam.new("key")raisedwrong number of arguments (given 1, expected 0).🤖 Generated with Claude Code
https://claude.ai/code/session_01SQW83gyXeUG61RDrHEky97