Skip to content

Conversation

@monadoid
Copy link
Contributor

@monadoid monadoid commented Jan 8, 2026

why

Once this PR is merged into core, we no longer need to send x-language and x-sdk-version headers in our generated SDKs, since they send the x-stainless equivalents 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.

  • Migration
    • Regenerate SDKs after the core change that adds x-stainless headers is merged.
    • Stop sending x-language and x-sdk-version in clients; rely on x-stainless headers.

Written for commit df65fe9. Summary will update on new commits.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: df65fe9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

✱ Stainless preview builds

This PR will update the stagehand SDKs with the following commit message.

feat: Removed requiring x-language and x-sdk-version from openapi spec
⚠️ stagehand-csharp studio · conflict

There was a regression in your SDK.

⚠️ stagehand-ruby studio · conflict

There was a regression in your SDK.

⚠️ stagehand-kotlin studio · code

There was a regression in your SDK.
generate ⚠️lint ✅test ✅

stagehand-php studio · code

Your SDK built successfully.
generate ✅lint ✅test ✅

⚠️ stagehand-java studio · code

There was a regression in your SDK.
generate ⚠️lint ❗test ❗

⚠️ stagehand-typescript studio · code

There was a regression in your SDK.
generate ✅build ✅lint ✅test ❗

npm install https://pkg.stainless.com/s/stagehand-typescript/0c8ad6ed33bfdb8b94985feb558da717ca873524/dist.tar.gz
⚠️ stagehand-go studio · code

There was a regression in your SDK.
generate ✅lint ❗test ❗

go get github.com/stainless-sdks/stagehand-go@fd90d99e87719080546ab183c6c655e4b3b02df5
⚠️ stagehand-python studio · code

There was a regression in your SDK.
generate ✅build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/stagehand-python/dea912c33346cefec38cebcc6f270bd237091fc1/stagehand_alpha-0.2.4-py3-none-any.whl
stagehand-cli studio · code

Your SDK built successfully.
generate ✅lint ✅test ✅


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
Last updated: 2026-01-10 00:06:20 UTC

@monadoid monadoid changed the title Removed requiring x-language and x-sdk-version from openapi spec Removed x-language and x-sdk-version from openapi spec Jan 8, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 SessionHeaders schema 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-language and reads x-sdk-version in packages/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-language values. 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.ts and client sending logic in packages/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
Loading

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 8, 2026

Additional Comments (2)

packages/server/openapi.v3.yaml
the server still reads x-language and x-sdk-version in packages/server/src/routes/v1/sessions/start.ts (lines 40-52). verify that server is backwards-compatible or updated to use x-stainless equivalents before deploying


packages/core/lib/v3/types/public/api.ts
the internal v3 API client in packages/core/lib/v3/api.ts still sends x-language and x-sdk-version headers (lines 657-658). update that code to remove or replace these headers with x-stainless equivalents

@monadoid monadoid merged commit a0bec91 into main Jan 9, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants