remove hardcoded agent temp#2068
Open
filip-michalsky wants to merge 4 commits intomainfrom
Open
Conversation
🦋 Changeset detectedLatest commit: a27102b The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
✱ Stainless preview buildsNo changes were made to the SDKs. This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
This reverts commit 9902f2f.
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant App as Client Application
participant Agent as V3AgentHandler
participant SDK as LLMClient (AI SDK)
participant Model as LLM Provider (e.g. OpenAI)
App->>Agent: execute(instruction) or stream(...)
Note over Agent: Prepare tools, messages,<br/>and stop conditions
alt Non-Streaming Path
Agent->>SDK: CHANGED: generateText(options)
Note right of Agent: NEW: temperature is omitted<br/>(previously hardcoded to 1)
SDK->>Model: Request without "temperature" field
else Streaming Path
Agent->>SDK: CHANGED: streamText(options)
Note right of Agent: NEW: temperature is omitted
SDK->>Model: Stream request without "temperature" field
end
alt Model is Reasoning Model (e.g. gpt-5-mini)
Model-->>SDK: Processes request successfully
Note over Model: No AI SDK warning emitted<br/>because temperature was not set
else Model is Standard Model (e.g. gpt-4o)
Model-->>SDK: Processes request successfully
Note over Model: Uses provider's internal<br/>default temperature
end
SDK-->>Agent: LLM Result/Stream
Agent-->>App: Task Result / Execution Logs
Collaborator
Author
|
That failing auto-captcha test is going to get removed. |
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.
why
Reasoning models (e.g.
openai/gpt-5-mini) emitAI SDK Warning: The "temperature" setting is not supported by this modelwhenever the v3 agentruns against them, because
V3AgentHandlerhardcodedtemperature: 1on everygenerateText/streamTextcall. There was no constructor oragent-config option to override it, so users running reasoning models with
experimental: truehad no way to silence the warning.what changed
temperature: 1from both the non-streaming and streaming agent paths inpackages/core/lib/v3/handlers/v3AgentHandler.ts.temperatureentirely, so the AI SDK no longer flags it as user-set on models that don't accept it. Models that do accepttemperature still default to the AI SDK provider's own default.
packages/core/tests/unit/agent-temperature.test.tsasserting neither code path passes atemperatureto the LLMclient.
.changeset/remove-agent-temperature-default.md).test plan
pnpm --filter @browserbasehq/stagehand test agent-temperature— new unit tests passagent.execute(...)againstopenai/gpt-5-miniwithexperimental: true— confirm no"temperature" setting is not supportedwarning in stderr
openai/gpt-4.1-mini) — confirm agent still completes a multi-step task end-to-end