Skip to content

Pull TypeScript OpenAI Agents code from the samples repo - #5137

Draft
brianstrauch wants to merge 1 commit into
mainfrom
docs/ts-openai-agents-snipsync
Draft

Pull TypeScript OpenAI Agents code from the samples repo#5137
brianstrauch wants to merge 1 commit into
mainfrom
docs/ts-openai-agents-snipsync

Conversation

@brianstrauch

@brianstrauch brianstrauch commented Aug 18, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Replaces the 16 hand-maintained inline TypeScript blocks on the OpenAI Agents SDK integration page with snipsync blocks backed by the openai-agents samples. Nothing verified those blocks, so they could drift from the SDK without any check failing.

Blocked on temporalio/samples-typescript#510, which adds the markers. Draft until that mergesyarn snipsync can't resolve the new IDs before then.

Notes to reviewers

The markers upstream are scoped to exactly what each block shows, so no block needs selectedLines and none renders a leading // ... elision.

Three blocks are deliberately not converted:

  • The two tracing snippets (hosted exporter registration, tracer-provider setup) stay inline, because the sample wraps both calls in a tracing-mode switch that would obscure the API.
  • The install commands stay inline, having no sample source.

Two sections are restructured, because the samples show in one place what the page showed in two:

  • MCP servers now registers both provider kinds in a single Worker snippet up front, and the stateless/stateful subsections cover only Workflow-side code.
  • Temporal orchestration spans would have duplicated the OpenTelemetry excerpt verbatim, so it's now prose pointing at that excerpt.

Some prose shifted to match the samples' identifiers rather than the invented ones the page used — helloWorld instead of haikuAgentWorkflow, and a note that the sample Worker sets useLocalActivity: true.

Verification

Snippet resolution was checked by temporarily pointing snipsync.config.yaml at a local clone of the samples branch and running yarn snipsync: all 17 IDs resolve and every excerpt dedents to column 0. That config change is not part of this PR. Re-run yarn snipsync once #510 merges; the committed content should be unchanged.

yarn build passes and vale --config .vale-ci.ini reports 0 errors/warnings on the page (one pre-existing sentence-case suggestion on the "Create a Hello World Workflow" heading, untouched here).

yarn check-links shows no new failure classes for this page — the /glossary#activity fragment-redirects it reports are systemic, with ~3000 hits site-wide.

🤖 Generated with Claude Code

┆Attachments: EDU-6984 Pull TypeScript OpenAI Agents code from the samples repo

The guide hand-maintained 16 inline TypeScript blocks that no CI job
verified, so they could drift from the SDK without anything failing.
Replace them with snipsync blocks backed by the openai-agents samples.

The markers upstream are scoped to exactly what each block shows, so no
block needs selectedLines and none renders a leading elision.

Two blocks stay inline on purpose, because the tracing sample wraps both
calls in a tracing-mode switch that would obscure the API: the hosted
exporter registration and the tracer-provider setup. The install commands
stay inline too, having no sample source.

Two blocks are also restructured, because the samples show the same thing
in one place where the page showed it in two:

- MCP now registers both provider kinds in one Worker snippet up front,
  and the stateless and stateful sections cover only Workflow-side code.
- The orchestration-spans block, which would have duplicated the
  OpenTelemetry excerpt verbatim, is now prose pointing at it.

Depends on the matching marker PR in temporalio/samples-typescript.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 18, 2026 22:25
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview Aug 18, 2026 10:26pm

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.

Pull request overview

Replaces unverified inline TypeScript examples with Snipsync-managed excerpts from the samples repository.

Changes:

  • Converts 16 examples to synchronized sample excerpts.
  • Restructures MCP and tracing guidance around sample code.
  • Aligns identifiers and Local Activity guidance with runnable samples.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +375 to 378
mcpServerProviders: [...statelessProviders, ...statefulProviders],
}),
],
```
new OpenAIAgentsPlugin({
modelProvider: new OpenAIProvider({ apiKey }),
modelParams: { useLocalActivity: true },
interceptorOptions: { useOtelInstrumentation, addTemporalSpans: true },
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