From 5106687a8c7a491cf3594370ebd91fba63da7634 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 17:46:25 +0000 Subject: [PATCH 1/6] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 391cde3..57aa7a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 8 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-6f6bfb81d092f30a5e2005328c97d61b9ea36132bb19e9e79e55294b9534ce20.yml -openapi_spec_hash: f3fc1e3688a38dc2c28f7178f7d534e5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-e629569417ad17cad5c73180109b4c3ae778f38063fc72146fa82f82de145911.yml +openapi_spec_hash: 42e4eedbc0fcc772bb271191a067bce1 config_hash: 1fb12ae9b478488bc1e56bfbdc210b01 From 304ebd8ea3e7c9b6621d5382fc1f4c51ce64fb8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 18:23:20 +0000 Subject: [PATCH 2/6] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 57aa7a5..094ac49 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 8 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-e629569417ad17cad5c73180109b4c3ae778f38063fc72146fa82f82de145911.yml -openapi_spec_hash: 42e4eedbc0fcc772bb271191a067bce1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-49b40c7425adba9e67fc102838c5216c45ca1f7ef4c10823c5665fd413538504.yml +openapi_spec_hash: 6880dc029df2e88dfe8943c0dec5a3a5 config_hash: 1fb12ae9b478488bc1e56bfbdc210b01 From 0acc093944e72ee488393ec1fb73dc16450cc825 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 18:26:04 +0000 Subject: [PATCH 3/6] feat: [feat]: add `ignoreSelectors` to `observe()` --- .stats.yml | 4 ++-- lib/stagehand/models/session_observe_params.rb | 10 +++++++++- rbi/stagehand/models/session_observe_params.rbi | 11 +++++++++++ sig/stagehand/models/session_observe_params.rbs | 7 +++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 094ac49..0339c57 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 8 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-49b40c7425adba9e67fc102838c5216c45ca1f7ef4c10823c5665fd413538504.yml -openapi_spec_hash: 6880dc029df2e88dfe8943c0dec5a3a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-eae8400fade7b2c8329c4148f56de92e147c34c0feecb420c015aab6544a9acc.yml +openapi_spec_hash: 0a9eff1ac1d464e89cbd9db64709b08a config_hash: 1fb12ae9b478488bc1e56bfbdc210b01 diff --git a/lib/stagehand/models/session_observe_params.rb b/lib/stagehand/models/session_observe_params.rb index b2c2f74..8564643 100644 --- a/lib/stagehand/models/session_observe_params.rb +++ b/lib/stagehand/models/session_observe_params.rb @@ -52,6 +52,12 @@ class SessionObserveParams < Stagehand::Internal::Type::BaseModel # @param request_options [Stagehand::RequestOptions, Hash{Symbol=>Object}] class Options < Stagehand::Internal::Type::BaseModel + # @!attribute ignore_selectors + # Selectors for elements and subtrees that should be excluded from observation + # + # @return [Array, nil] + optional :ignore_selectors, Stagehand::Internal::Type::ArrayOf[String], api_name: :ignoreSelectors + # @!attribute model # Model configuration object or model name string (e.g., 'openai/gpt-5-nano') # @@ -79,10 +85,12 @@ class Options < Stagehand::Internal::Type::BaseModel optional :variables, -> { Stagehand::Internal::Type::HashOf[union: Stagehand::SessionObserveParams::Options::Variable] } - # @!method initialize(model: nil, selector: nil, timeout: nil, variables: nil) + # @!method initialize(ignore_selectors: nil, model: nil, selector: nil, timeout: nil, variables: nil) # Some parameter documentations has been truncated, see # {Stagehand::Models::SessionObserveParams::Options} for more details. # + # @param ignore_selectors [Array] Selectors for elements and subtrees that should be excluded from observation + # # @param model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano') # # @param selector [String] CSS selector to scope observation to a specific element diff --git a/rbi/stagehand/models/session_observe_params.rbi b/rbi/stagehand/models/session_observe_params.rbi index ba48ed4..240e691 100644 --- a/rbi/stagehand/models/session_observe_params.rbi +++ b/rbi/stagehand/models/session_observe_params.rbi @@ -100,6 +100,13 @@ module Stagehand ) end + # Selectors for elements and subtrees that should be excluded from observation + sig { returns(T.nilable(T::Array[String])) } + attr_reader :ignore_selectors + + sig { params(ignore_selectors: T::Array[String]).void } + attr_writer :ignore_selectors + # Model configuration object or model name string (e.g., 'openai/gpt-5-nano') sig { returns(T.nilable(T.any(Stagehand::ModelConfig, String))) } attr_reader :model @@ -161,6 +168,7 @@ module Stagehand sig do params( + ignore_selectors: T::Array[String], model: T.any(Stagehand::ModelConfig::OrHash, String), selector: String, timeout: Float, @@ -177,6 +185,8 @@ module Stagehand ).returns(T.attached_class) end def self.new( + # Selectors for elements and subtrees that should be excluded from observation + ignore_selectors: nil, # Model configuration object or model name string (e.g., 'openai/gpt-5-nano') model: nil, # CSS selector to scope observation to a specific element @@ -193,6 +203,7 @@ module Stagehand sig do override.returns( { + ignore_selectors: T::Array[String], model: T.any(Stagehand::ModelConfig, String), selector: String, timeout: Float, diff --git a/sig/stagehand/models/session_observe_params.rbs b/sig/stagehand/models/session_observe_params.rbs index 4aad068..063b837 100644 --- a/sig/stagehand/models/session_observe_params.rbs +++ b/sig/stagehand/models/session_observe_params.rbs @@ -54,6 +54,7 @@ module Stagehand type options = { + ignore_selectors: ::Array[String], model: Stagehand::Models::SessionObserveParams::Options::model, selector: String, timeout: Float, @@ -61,6 +62,10 @@ module Stagehand } class Options < Stagehand::Internal::Type::BaseModel + attr_reader ignore_selectors: ::Array[String]? + + def ignore_selectors=: (::Array[String]) -> ::Array[String] + attr_reader model: Stagehand::Models::SessionObserveParams::Options::model? def model=: ( @@ -82,6 +87,7 @@ module Stagehand ) -> ::Hash[Symbol, Stagehand::Models::SessionObserveParams::Options::variable] def initialize: ( + ?ignore_selectors: ::Array[String], ?model: Stagehand::Models::SessionObserveParams::Options::model, ?selector: String, ?timeout: Float, @@ -89,6 +95,7 @@ module Stagehand ) -> void def to_hash: -> { + ignore_selectors: ::Array[String], model: Stagehand::Models::SessionObserveParams::Options::model, selector: String, timeout: Float, From 9590ccac39407c027e9e2ea3649a719b00660170 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 02:01:24 +0000 Subject: [PATCH 4/6] ci: pin GitHub Actions to commit SHAs Pin all GitHub Actions referenced in generated workflows (both first-party `actions/*` and third-party) to immutable commit SHAs. Updating pinned actions is now a deliberate codegen-side bump rather than implicit on every workflow run. --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/publish-gem.yml | 4 ++-- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7356e9e..bd96cf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: github.repository == 'stainless-sdks/stagehand-ruby' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -39,7 +39,7 @@ jobs: github.repository == 'stainless-sdks/stagehand-ruby' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -60,9 +60,9 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -76,9 +76,9 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/stagehand-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 160f82b..c47e5b8 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 801df3e..e75d806 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'browserbase/stagehand-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | From 6149c11d9ab60a0cac69f1e26e3a2f42425ad616 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 02:01:27 +0000 Subject: [PATCH 5/6] fix(client): elide content type header on requests without body --- lib/stagehand/internal/transport/base_client.rb | 2 ++ test/stagehand/client_test.rb | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/stagehand/internal/transport/base_client.rb b/lib/stagehand/internal/transport/base_client.rb index 54200c4..9b452d3 100644 --- a/lib/stagehand/internal/transport/base_client.rb +++ b/lib/stagehand/internal/transport/base_client.rb @@ -306,6 +306,8 @@ def initialize( Stagehand::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end + headers.delete("content-type") if body.nil? + url = Stagehand::Internal::Util.join_parsed_uri( @base_url_components, {**req, path: path, query: query} diff --git a/test/stagehand/client_test.rb b/test/stagehand/client_test.rb index 4b96ac0..dc061f1 100644 --- a/test/stagehand/client_test.rb +++ b/test/stagehand/client_test.rb @@ -356,8 +356,8 @@ def test_client_redirect_307 assert_equal(recorded.method, _1.method) assert_equal(recorded.body, _1.body) assert_equal( - recorded.headers.transform_keys(&:downcase).fetch("content-type"), - _1.headers.transform_keys(&:downcase).fetch("content-type") + recorded.headers.transform_keys(&:downcase)["content-type"], + _1.headers.transform_keys(&:downcase)["content-type"] ) end end @@ -474,8 +474,9 @@ def test_default_headers stagehand.sessions.start(model_name: "openai/gpt-5.4-mini") assert_requested(:any, /./) do |req| - headers = req.headers.transform_keys(&:downcase).fetch_values("accept", "content-type") - headers.each { refute_empty(_1) } + headers = req.headers.transform_keys(&:downcase) + expected = req.body.nil? ? ["accept"] : %w[accept content-type] + headers.fetch_values(*expected).each { refute_empty(_1) } end end end From 0c355846b0a09c484a5f3682f32234593236fc41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 02:01:51 +0000 Subject: [PATCH 6/6] release: 3.21.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ Gemfile.lock | 2 +- lib/stagehand/version.rb | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d11c8fc..eba8a04 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.20.0" + ".": "3.21.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd0ed0..4e0bd39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.21.0 (2026-05-14) + +Full Changelog: [v3.20.0...v3.21.0](https://github.com/browserbase/stagehand-ruby/compare/v3.20.0...v3.21.0) + +### Features + +* [feat]: add `ignoreSelectors` to `observe()` ([0acc093](https://github.com/browserbase/stagehand-ruby/commit/0acc093944e72ee488393ec1fb73dc16450cc825)) + + +### Bug Fixes + +* **client:** elide content type header on requests without body ([6149c11](https://github.com/browserbase/stagehand-ruby/commit/6149c11d9ab60a0cac69f1e26e3a2f42425ad616)) + ## 3.20.0 (2026-05-06) Full Changelog: [v3.19.3...v3.20.0](https://github.com/browserbase/stagehand-ruby/compare/v3.19.3...v3.20.0) diff --git a/Gemfile.lock b/Gemfile.lock index 4490644..adcbab3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - stagehand (3.20.0) + stagehand (3.21.0) cgi connection_pool diff --git a/lib/stagehand/version.rb b/lib/stagehand/version.rb index 2fbf718..bffebd2 100644 --- a/lib/stagehand/version.rb +++ b/lib/stagehand/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Stagehand - VERSION = "3.20.0" + VERSION = "3.21.0" end