-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Removed x-language and x-sdk-version from openapi spec #1515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
✱ Stainless preview buildsThis PR will update the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
Removed x-language and x-sdk-version headers from the OpenAPI spec and TypeScript type definitions to transition to Stainless-provided equivalents.
Changes:
- Removed header definitions from
SessionHeadersschema in both OpenAPI spec and TypeScript types - Affects all v3 API endpoints (start, end, act, extract, observe, navigate, agentExecute)
Critical coordination required:
- Server code still validates
x-languageand readsx-sdk-versioninpackages/server/src/routes/v1/sessions/start.ts - Internal v3 API client still sends these headers in
packages/core/lib/v3/api.ts - Test fixtures use these headers in
packages/server/test/api-client.integration.test.ts
These need to be updated before or alongside this change to prevent breaking existing functionality.
Confidence Score: 2/5
- This PR has coordination issues that need resolution before merging
- While the spec changes are correct, the server still validates these headers and will reject requests with invalid
x-languagevalues. The internal client and tests also still send these headers. Without coordinated updates, this could break existing functionality. - Pay attention to server validation logic in
packages/server/src/routes/v1/sessions/start.tsand client sending logic inpackages/core/lib/v3/api.ts
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| packages/server/openapi.v3.yaml | 5/5 | Removed x-language and x-sdk-version header definitions from all endpoints and components schema |
| packages/core/lib/v3/types/public/api.ts | 5/5 | Removed x-language and x-sdk-version fields from SessionHeadersSchema |
Sequence Diagram
sequenceDiagram
participant Client as Generated SDK Client
participant Server as Stagehand Server
participant Stainless as Stainless SDK
Note over Client,Stainless: Before this PR
Client->>Server: POST /v1/sessions/start<br/>Headers: x-language, x-sdk-version
Server->>Server: Validate x-language header
Server->>Server: Read x-sdk-version
Server-->>Client: Response
Note over Client,Stainless: After this PR (intended)
Stainless->>Server: POST /v1/sessions/start<br/>Headers: x-stainless equivalents
Server->>Server: Use x-stainless headers
Server-->>Stainless: Response
Note over Client,Server: Current Issue
Note over Server: Server still validates x-language<br/>and reads x-sdk-version
Note over Client: Internal v3 client still<br/>sends old headers
Additional Comments (2)
|
why
Once this PR is merged into core, we no longer need to send
x-languageandx-sdk-versionheaders in our generated SDKs, since they send thex-stainlessequivalents automatically.what changed
Thus, this PR removes these from the openapi spec, so that the generated clients will stop having these fields.
test plan
Will ensure that new generated sdks work successfully.
Summary by cubic
Removed x-language and x-sdk-version headers from the OpenAPI spec and server types, since generated SDKs now send x-stainless headers automatically. This simplifies SDK generation and removes redundant headers.
Written for commit df65fe9. Summary will update on new commits.