Skip to content

AI-266: Add @temporalio/openai-agents sample suite#479

Open
xumaple wants to merge 2 commits into
mainfrom
maplexu/AI-266-openai-agents-samples
Open

AI-266: Add @temporalio/openai-agents sample suite#479
xumaple wants to merge 2 commits into
mainfrom
maplexu/AI-266-openai-agents-samples

Conversation

@xumaple

@xumaple xumaple commented Jun 15, 2026

Copy link
Copy Markdown

Adds fourteen self-contained samples under openai-agents/ — the basic building blocks, handoffs, agent patterns, sessions, human approval, hosted/Nexus/MCP tools, tracing, model providers, reasoning content, a research bot, and a customer-service chat. Each is a standalone package with a fake-model Worker test that runs without an API key, and the suite is wired into the pnpm workspace, CI, and the samples list.

@xumaple xumaple requested a review from a team as a code owner June 15, 2026 19:15
@semgrep-managed-scans

Copy link
Copy Markdown

Semgrep found 14 ssc-ed1933c3-2b29-4ebf-a055-88299d5ce18a findings:

  • openai-agents/tracing/src/client.ts
  • openai-agents/tools/src/client.ts
  • openai-agents/sessions/src/client.ts
  • openai-agents/research-bot/src/client.ts
  • openai-agents/reasoning-content/src/client.ts
  • openai-agents/nexus-tools/src/client.ts
  • openai-agents/model-providers/src/client.ts
  • openai-agents/mcp/src/client.ts
  • openai-agents/human-approval/src/client.ts
  • openai-agents/hosted-mcp/src/client.ts
  • openai-agents/handoffs/src/client.ts
  • openai-agents/customer-service/src/client.ts
  • openai-agents/basic/src/client.ts
  • openai-agents/agent-patterns/src/client.ts

Risk: Affected versions of nanoid are vulnerable to Exposure of Sensitive Information to an Unauthorized Actor / Incorrect Type Conversion or Cast. nanoid is vulnerable to information exposure (CVE-2021-23566). Passing a non-integer object with a crafted valueOf() method as the size argument to nanoid(), or to the generators returned by customAlphabet() and customRandom(), tricks the internal random-byte pool into reusing previously generated bytes, allowing a prior ID to be reproduced. Upgrade to nanoid >= 3.1.31.

Fix: Upgrade this library to at least version 3.1.31 at samples-typescript/pnpm-lock.yaml:13366.

Reference(s): GHSA-qrpm-p2h7-hrv2, CVE-2021-23566

Fourteen self-contained samples demonstrating how to run OpenAI Agents SDK agents
as Temporal Workflows with the @temporalio/openai-agents integration: the basic
building blocks, handoffs, agent patterns, sessions, human approval, hosted/Nexus/MCP
tools, tracing, model providers, reasoning content, a research bot, and a
customer-service chat. Each sample is a standalone package with a fake-model Worker
test that runs without an API key, and the suite is wired into the pnpm workspace,
CI, and the samples list.
@xumaple xumaple force-pushed the maplexu/AI-266-openai-agents-samples branch from 643db6d to d33a6dc Compare June 15, 2026 20:04
@xumaple xumaple marked this pull request as draft June 15, 2026 20:07
@xumaple xumaple marked this pull request as ready for review June 16, 2026 16:29
// Some samples have different config files from those in .shared/
// that we don't want to overwrite
const TSCONFIG_EXCLUDE = [
'openai-agents',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

temporal server start-dev
```

Point the Worker at your OpenAI-compatible endpoint. For example, a local Ollama server:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be useful to demonstrate how to start a OpenAI-compatible Ollama server? I assume it would just be a 1-liner

@@ -0,0 +1,39 @@
# OpenAI Agents: Research Bot

A multi-agent research Workflow built with `@temporalio/openai-agents`. It mirrors the OpenAI Agents

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The more samples I write, I think most people (and agents) that read samples are typically searching for samples of specific features, not for specific use cases. There are also N features for each plugin and infinite use cases.

What do you think about modifying the title of some of these samples to refer to a feature? (In this case, it looks like we're showing off a multi-agent workflow)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"customer-service" is another one that could probably use a title change.

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.

2 participants