Skip to content

Show agent.asTool() instead of agentAsTool on the TypeScript OpenAI Agents page - #5597

Open
campoy wants to merge 4 commits into
mainfrom
openai-agents-typescript-native-as-tool
Open

campoy wants to merge 4 commits into
mainfrom
openai-agents-typescript-native-as-tool

Conversation

@campoy

@campoy campoy commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Updates the TypeScript OpenAI Agents SDK integration page for temporalio/ai-integrations#270, which removes the integration's agentAsTool and makes the OpenAI Agents SDK's own agent.asTool() work in Workflows.

  • Agents as tools now use agent.asTool(). The page drops agentAsTool, its options table and the NestedAgentInterruption error.
  • The notes on nested runs now say what they get from the parent run: its context, runConfig.model for agents that set no model, runConfig.modelSettings, and the runner's model Activity options. They also say that a nested approval pauses the parent run and that a nested run's failure goes back to the model as the tool's output.
  • Breaking: run TypeScript OpenAI Agents as written: agent.asTool() works, runConfig.model no longer overrides an agent's own model, agentAsTool is deprecated ai-integrations#270 also stops cloning agents, so the page now says:
    • runConfig.model applies to agents that set no model of their own, as in the SDK;
    • agent.on(...) lifecycle hooks are supported;
    • asTool() tools must be created in Workflow code, and the nested setups the runner rejects are listed, with the matching error types.

Notes to reviewers

Draft until temporalio/ai-integrations#270 is merged and released. When it is, this page can name the release.

Checked on a build of temporalio/ai-integrations#270, on a local dev server with a scripted model:

That runConfig.sandbox is passed on to nested runs comes from the OpenAI Agents SDK's code. It wasn't run here.

The agent patterns sample moves to agent.asTool() in temporalio/samples-typescript#534.

Vale didn't run locally. The page isn't Prettier-clean on main, so only the changed paragraphs are rewrapped.

@vercel

vercel Bot commented Oct 29, 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 1:56am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

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.

🔵 Needs a closer look

Core runtime claims depend on temporalio/ai-integrations#270 and an unverified release, requiring an integration owner to confirm nested-run behavior and release compatibility before publication.

No open issues 🎉

What changed in this PR

Updates the TypeScript OpenAI Agents integration documentation for the upstream switch from agentAsTool to the SDK’s native agent.asTool(). The PR remains draft pending the upstream merge and release.

Changes:

  • Replaces agentAsTool references and removes its options table and NestedAgentInterruption error.
  • Revises nested-run configuration inheritance, approval handling, and failure behavior.
  • Documents lifecycle-hook support, model-selection precedence, and validation requirements for nested tools.
File Description
docs/​develop/​typescript/​integrations/​openai-agents.mdx Aligns usage guidance, compatibility tables, API reference, and error documentation with agent.asTool().

Review effort: Balanced

@campoy
campoy added this pull request to stack #5798 November 23, 2026 20:08
@temporalio/openai-agents 2.0.0 keeps agentAsTool as a deprecated alias that
calls agent.asTool(), so readers with existing code know to replace it.
@campoy

campoy commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @xumaple. Are you ok with @Duncanma merging?

This branch was successfully deployed

1 active deployment
Preview — e58102f6 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.

4 participants