Skip to content

Fix TypeScript OpenAI Agents page for 2.0.0 - #5757

Open
starfleeth wants to merge 4 commits into
openai-agents-typescript-native-as-toolfrom
docs/ai-integrations-ga-ts-openai-agents
Open

starfleeth wants to merge 4 commits into
openai-agents-typescript-native-as-toolfrom
docs/ai-integrations-ga-ts-openai-agents

Conversation

@starfleeth

@starfleeth starfleeth commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Updates the TypeScript OpenAI Agents page for @temporalio/openai-agents 2.0.0, on top of #5597.

  • Requires Node.js 22.12 or later. Limits version matching to the core Temporal TypeScript SDK packages, recommends SDK 1.25.0 or later within 1.x to match the samples, and explains that the integration is versioned separately.
  • Fixes OpenTelemetry setup and the model Activity heartbeat default.
  • Documents the Worker-only tracingApiKey callback, including its inputs, return value, and Client scope. A run's tracing: { apiKey } throws.
  • Syncs the sandbox Worker snippet from Move the OpenAI Agents samples to 2.0.0 and agent.asTool() samples-typescript#534. Explains OnHostSandboxClientProvider, Worker routing, approval pauses, restarts, SandboxLost, and provider migration.
  • Adds the hosted-tools Workflow bundle setting from the same sample update: ignoreModules: ['openai'].
  • Corrects tool failure propagation. A failed activityAsTool or nexusOperationAsTool call gives an AgentsWorkflowError with the Temporal failure as its cause. It is retryable even when the underlying Activity or Operation error is non-retryable, and an uncaught failure ends a streamed Workflow too.

Notes to reviewers

Based on #5597's branch (openai-agents-typescript-native-as-tool). Merge #5597 first, then retarget this PR to main.

Behavior was checked against the integration's 2.0.0 source and the merged samples PR. No runtime integration tests were rerun for this docs change.

Validation

In Docker, using Node 24 and the repository's locked dependencies:

  • Snipsync refreshed only this page from samples-typescript.
  • vale --config .vale-ci.ini docs/develop/typescript/integrations/openai-agents.mdx: no errors, warnings, or suggestions.
  • yarn check:snipsync-markers: no mismatched markers.
  • yarn build: passed, including the font preload check.

git diff --check passes.

Correct the Node.js and @temporalio/* version requirements, the
OpenTelemetry 2 tracer provider setup, the model Activity heartbeat
default, the per-run tracing key exception, and the shape of the
AgentsWorkflowError a failed Activity or Nexus tool produces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Nov 24, 2026 2:21am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

normalizeAgentsRunError marks it non-retryable only when the tool's Temporal
failure is itself a non-retryable ApplicationFailure. An activityAsTool or
nexusOperationAsTool failure is an ActivityFailure or NexusOperationFailure,
so the error is retryable even when the Activity's own error was not
(errors.test.ts at typescript/openai-agents/v2.0.0). The table row also
opened with "Non-retryable.", which contradicted the tool case.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation still gives contradictory package-version requirements and omits the tracingApiKey option’s Worker-only scope and resolver callback contract, leaving readers without clear installation and migration guidance.

2 open issues
What changed in this PR

Updates the TypeScript OpenAI Agents integration documentation for @temporalio/openai-agents 2.0.0, building on the native agent.asTool() changes in #5597.

Changes:

  • Clarifies Node.js requirements and Temporal SDK version compatibility.
  • Updates OpenTelemetry setup, heartbeat defaults, and per-run tracing-key guidance.
  • Revises error propagation, retryability, and streaming failure documentation.
File Description
docs/​develop/​typescript/​integrations/​openai-agents.mdx Updates integration requirements, configuration, and error-handling guidance for 2.0.0.

Review effort: Balanced

Comment on lines +54 to +55
and npm picks versions that match. Keep every `@temporalio/*` package in your application on the same version. The
integration works with any 1.x release from 1.24.0 on.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in de79334. The version-matching rule now applies to the core Temporal TypeScript SDK packages, and the page says that @temporalio/openai-agents is versioned separately. It recommends SDK 1.25.0 or later within 1.x to match the updated samples.

| --- | --- | --- | --- |
| Constructor | `defaultModelParams` | None | Model Activity options set in Workflow code, which also reach Workflows started without the plugin, such as by a Schedule or the Temporal CLI. The Client's `modelParams` take precedence for each field they set. `agent.asTool()` nested runs use the same options. |
| `run()` | `context`, `maxTurns`, `previousResponseId`, `conversationId`, `session`, `sessionInputCallback`, `callModelInputFilter`, `tracing` | SDK defaults | As in the SDK's run options. `session` can't be the SDK's `MemorySession`. Other SDK run options, such as `signal`, `errorHandlers`, `toolErrorFormatter`, and `toolExecution`, aren't accepted. |
| `run()` | `context`, `maxTurns`, `previousResponseId`, `conversationId`, `session`, `sessionInputCallback`, `callModelInputFilter`, `tracing` | SDK defaults | As in the SDK's run options, except that `tracing: { apiKey }` throws. Resolve a per-run tracing key on the Worker with the plugin's `tracingApiKey` option. `session` can't be the SDK's `MemorySession`. Other SDK run options, such as `signal`, `errorHandlers`, `toolErrorFormatter`, and `toolExecution`, aren't accepted. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in de79334. The plugin options table now lists tracingApiKey as Worker-only and gives its synchronous callback inputs and string | undefined return value. The tracing section also explains that keys stay out of Event History and that Client traces keep the Client's default key.

@xumaple

xumaple commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

We need to include the OnHostSandboxClientProvider changes from temporalio/samples-typescript#534 here as well.

@campoy

campoy commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Included the sandbox changes from temporalio/samples-typescript#534 in de79334. Snipsync now brings in OnHostSandboxClientProvider, and the page explains routing to the creating Worker, approval pauses, restarts, SandboxLost, and migration from the old provider.

I also added the hosted-tools ignoreModules: ['openai'] setting from that sample update and corrected the related feature and configuration tables. The install section recommends SDK 1.25.0 to match the samples and says the integration is versioned separately.

The Docker site build, CI-scoped Vale, Snipsync marker check, and git diff --check pass. This still targets #5597's branch; that PR needs to merge first.

This branch was successfully deployed

1 active deployment
Preview — de79334b Deployed Nov 24, 2026 by vercel[bot]
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.

5 participants