Conversation
There was a problem hiding this comment.
No issues found across 6 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant User as User Application
participant SDK as Stagehand SDK
participant Serializer as Request Serializer
participant API as Stagehand API
Note over User, API: Session Interaction (Observe, Extract, or Execute)
User->>SDK: call method (e.g., observe, extract, execute)
Note right of User: model can be "string" or {config_object}
SDK->>Serializer: CHANGED: Process AgentConfig / Options
alt Model is a String
Serializer->>Serializer: Pass model name as-is
else NEW: Model is a Config Object
Serializer->>Serializer: Map snake_case to camelCase
Note right of Serializer: e.g. api_key -> apiKey<br/>model_name -> modelName<br/>base_url -> baseURL
end
Serializer-->>SDK: Serialized JSON payload
SDK->>API: POST /v1/sessions/{id}/[action]
Note right of SDK: Headers: Authorization, etc.<br/>Body: { "options": { "model": ... } }
alt API Success
API-->>SDK: 200 OK (Data)
SDK-->>User: Return Result
else API Error
API-->>SDK: 4xx/5xx Error
SDK-->>User: Raise Exception
end
Note over User, API: Sync and Async flows follow the same serialization logic
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.
Summary by cubic
Add tests confirming model options can be passed as a string or as a config object, and update types to accept both. Ensures correct request serialization for sync and async session APIs.
Refactors
OptionsModelalias and updatedAgentConfig/Optionsto acceptUnion[ModelConfigParam, str]; simplified docstrings..start,.observe,.extract, and.execute(sync and async) to validate camel-cased wire keys and mixed model shapes.Dependencies
stagehandto3.19.4inuv.lock.Written for commit 1f9ae2e. Summary will update on new commits. Review in cubic