Repository navigation
Fix TypeScript OpenAI Agents page for 2.0.0 - #5757
starfleeth wants to merge 4 commits into
Conversation
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 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📖 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.
There was a problem hiding this comment.
🟡 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
| 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. |
There was a problem hiding this comment.
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. | |
There was a problem hiding this comment.
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.
|
We need to include the |
…as-tool' into docs/pr5757-review-comments
|
Included the sandbox changes from temporalio/samples-typescript#534 in de79334. Snipsync now brings in I also added the hosted-tools The Docker site build, CI-scoped Vale, Snipsync marker check, and |

What does this PR do?
Updates the TypeScript OpenAI Agents page for
@temporalio/openai-agents2.0.0, on top of #5597.tracingApiKeycallback, including its inputs, return value, and Client scope. A run'stracing: { apiKey }throws.OnHostSandboxClientProvider, Worker routing, approval pauses, restarts,SandboxLost, and provider migration.ignoreModules: ['openai'].activityAsToolornexusOperationAsToolcall gives anAgentsWorkflowErrorwith 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 tomain.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:
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 --checkpasses.