Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.3.0"
".": "3.4.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-43e6dd4ce19381de488d296e9036fea15bfea9a6f946cf8ccf4e02aecc8fb765.yml
openapi_spec_hash: f736e7a8acea0d73e1031c86ea803246
config_hash: b375728ccf7d33287335852f4f59c293
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-8fbb3fa8f3a37c1c7408de427fe125aadec49f705e8e30d191601a9b69c4cc41.yml
openapi_spec_hash: 48b4dfac35a842d7fb0d228caf87544e
config_hash: 242651c4871c2869ba3c2e3d337505b9
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.4.0 (2026-01-29)

Full Changelog: [v3.3.0...v3.4.0](https://github.com/browserbase/stagehand-ruby/compare/v3.3.0...v3.4.0)

### Features

* Add executionModel serialization to api client ([2042742](https://github.com/browserbase/stagehand-ruby/commit/20427425012c9ee785d18a74596808471be2dc7b))

## 3.3.0 (2026-01-29)

Full Changelog: [v3.2.1...v3.3.0](https://github.com/browserbase/stagehand-ruby/compare/v3.2.1...v3.3.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
stagehand (3.3.0)
stagehand (3.4.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion lib/stagehand/internal/stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Stream
next if consume

case msg
in {data: String => data} if data.start_with?("{\"data\":{\"status\":\"finished\"")
in {data: String => data} if data.start_with?("finished")
consume = true
next
in {data: String => data} if data.start_with?("error")
Expand Down
30 changes: 29 additions & 1 deletion lib/stagehand/models/session_execute_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ class AgentConfig < Stagehand::Internal::Type::BaseModel
# @return [Boolean, nil]
optional :cua, Stagehand::Internal::Type::Boolean

# @!attribute execution_model
# Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
# tool execution (observe/act calls within agent tools). If not specified,
# inherits from the main model configuration.
#
# @return [Stagehand::Models::ModelConfig, String, nil]
optional :execution_model,
union: -> { Stagehand::SessionExecuteParams::AgentConfig::ExecutionModel },
api_name: :executionModel

# @!attribute mode
# Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
#
Expand All @@ -84,12 +94,14 @@ class AgentConfig < Stagehand::Internal::Type::BaseModel
# @return [String, nil]
optional :system_prompt, String, api_name: :systemPrompt

# @!method initialize(cua: nil, mode: nil, model: nil, provider: nil, system_prompt: nil)
# @!method initialize(cua: nil, execution_model: nil, mode: nil, model: nil, provider: nil, system_prompt: nil)
# Some parameter documentations has been truncated, see
# {Stagehand::Models::SessionExecuteParams::AgentConfig} for more details.
#
# @param cua [Boolean] Deprecated. Use mode: 'cua' instead. If both are provided, mode takes precedence
#
# @param execution_model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
#
# @param mode [Symbol, Stagehand::Models::SessionExecuteParams::AgentConfig::Mode] Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
#
# @param model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
Expand All @@ -98,6 +110,22 @@ class AgentConfig < Stagehand::Internal::Type::BaseModel
#
# @param system_prompt [String] Custom system prompt for the agent

# Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
# tool execution (observe/act calls within agent tools). If not specified,
# inherits from the main model configuration.
#
# @see Stagehand::Models::SessionExecuteParams::AgentConfig#execution_model
module ExecutionModel
extend Stagehand::Internal::Type::Union

variant -> { Stagehand::ModelConfig }

variant String

# @!method self.variants
# @return [Array(Stagehand::Models::ModelConfig, String)]
end

# Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
#
# @see Stagehand::Models::SessionExecuteParams::AgentConfig#mode
Expand Down
2 changes: 1 addition & 1 deletion lib/stagehand/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Stagehand
VERSION = "3.3.0"
VERSION = "3.4.0"
end
38 changes: 38 additions & 0 deletions rbi/stagehand/models/session_execute_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ module Stagehand
sig { params(cua: T::Boolean).void }
attr_writer :cua

# Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
# tool execution (observe/act calls within agent tools). If not specified,
# inherits from the main model configuration.
sig { returns(T.nilable(T.any(Stagehand::ModelConfig, String))) }
attr_reader :execution_model

sig do
params(
execution_model: T.any(Stagehand::ModelConfig::OrHash, String)
).void
end
attr_writer :execution_model

# Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
sig do
returns(
Expand Down Expand Up @@ -171,6 +184,7 @@ module Stagehand
sig do
params(
cua: T::Boolean,
execution_model: T.any(Stagehand::ModelConfig::OrHash, String),
mode: Stagehand::SessionExecuteParams::AgentConfig::Mode::OrSymbol,
model: T.any(Stagehand::ModelConfig::OrHash, String),
provider:
Expand All @@ -182,6 +196,10 @@ module Stagehand
# Deprecated. Use mode: 'cua' instead. If both are provided, mode takes
# precedence.
cua: nil,
# Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
# tool execution (observe/act calls within agent tools). If not specified,
# inherits from the main model configuration.
execution_model: nil,
# Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
mode: nil,
# Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
Expand All @@ -197,6 +215,7 @@ module Stagehand
override.returns(
{
cua: T::Boolean,
execution_model: T.any(Stagehand::ModelConfig, String),
mode:
Stagehand::SessionExecuteParams::AgentConfig::Mode::OrSymbol,
model: T.any(Stagehand::ModelConfig, String),
Expand All @@ -209,6 +228,25 @@ module Stagehand
def to_hash
end

# Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
# tool execution (observe/act calls within agent tools). If not specified,
# inherits from the main model configuration.
module ExecutionModel
extend Stagehand::Internal::Type::Union

Variants = T.type_alias { T.any(Stagehand::ModelConfig, String) }

sig do
override.returns(
T::Array[
Stagehand::SessionExecuteParams::AgentConfig::ExecutionModel::Variants
]
)
end
def self.variants
end
end

# Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
module Mode
extend Stagehand::Internal::Type::Enum
Expand Down
17 changes: 17 additions & 0 deletions sig/stagehand/models/session_execute_params.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module Stagehand
type agent_config =
{
cua: bool,
execution_model: Stagehand::Models::SessionExecuteParams::AgentConfig::execution_model,
mode: Stagehand::Models::SessionExecuteParams::AgentConfig::mode,
model: Stagehand::Models::SessionExecuteParams::AgentConfig::model,
provider: Stagehand::Models::SessionExecuteParams::AgentConfig::provider,
Expand All @@ -62,6 +63,12 @@ module Stagehand

def cua=: (bool) -> bool

attr_reader execution_model: Stagehand::Models::SessionExecuteParams::AgentConfig::execution_model?

def execution_model=: (
Stagehand::Models::SessionExecuteParams::AgentConfig::execution_model
) -> Stagehand::Models::SessionExecuteParams::AgentConfig::execution_model

attr_reader mode: Stagehand::Models::SessionExecuteParams::AgentConfig::mode?

def mode=: (
Expand All @@ -86,6 +93,7 @@ module Stagehand

def initialize: (
?cua: bool,
?execution_model: Stagehand::Models::SessionExecuteParams::AgentConfig::execution_model,
?mode: Stagehand::Models::SessionExecuteParams::AgentConfig::mode,
?model: Stagehand::Models::SessionExecuteParams::AgentConfig::model,
?provider: Stagehand::Models::SessionExecuteParams::AgentConfig::provider,
Expand All @@ -94,12 +102,21 @@ module Stagehand

def to_hash: -> {
cua: bool,
execution_model: Stagehand::Models::SessionExecuteParams::AgentConfig::execution_model,
mode: Stagehand::Models::SessionExecuteParams::AgentConfig::mode,
model: Stagehand::Models::SessionExecuteParams::AgentConfig::model,
provider: Stagehand::Models::SessionExecuteParams::AgentConfig::provider,
system_prompt: String
}

type execution_model = Stagehand::ModelConfig | String

module ExecutionModel
extend Stagehand::Internal::Type::Union

def self?.variants: -> ::Array[Stagehand::Models::SessionExecuteParams::AgentConfig::execution_model]
end

type mode = :dom | :hybrid | :cua

module Mode
Expand Down