Pull TypeScript OpenAI Agents code from the samples repo - #5137
Open
brianstrauch wants to merge 2 commits into
Open
Pull TypeScript OpenAI Agents code from the samples repo#5137brianstrauch wants to merge 2 commits into
brianstrauch wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📖 Docs PR preview links
|
Contributor
There was a problem hiding this comment.
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.
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>
brianstrauch
force-pushed
the
docs/ts-openai-agents-snipsync
branch
from
August 19, 2026 19:05
b2bec4a to
f8731f5
Compare
brianstrauch
marked this pull request as ready for review
August 19, 2026 19:07
brianstrauch
marked this pull request as draft
August 19, 2026 19:30
brianstrauch
marked this pull request as ready for review
August 19, 2026 19:41
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
docs/develop/typescript/integrations/openai-agents.mdx:675
- This identifies only the Worker configuration, but these options must also be set on the Client plugin: its interceptor injects
addTemporalSpansanduseOtelInstrumentationinto the Workflow-start header. With the Client setup above, Client and Workflow orchestration spans remain disabled. Configure both plugin instances with these options, and register the replay-safe tracer provider in every process whereuseOtelInstrumentation: trueis constructed.
Set `addTemporalSpans: true` to emit `temporal:*` agent-SDK spans for orchestration operations such as Workflow starts,
Signals, Queries, Updates, Activities, child Workflows, Nexus Operations, and Continue-As-New. It sits alongside
`useOtelInstrumentation` in `interceptorOptions`, as shown in the Worker above.
docs/develop/typescript/integrations/openai-agents.mdx:142
modelParamsreach the Workflow only through the config header injected by the Client plugin. Because this Client instance omitsmodelParams, theuseLocalActivity: trueshown on the Worker does not take effect; model calls remain regular Activities, contrary to lines 125–126. AddmodelParams: { useLocalActivity: true }to this Client plugin in the source sample and regenerate the snippet (or remove the Worker-side claim).
This issue also appears on line 673 of the same file.
plugins: [new OpenAIAgentsPlugin({ modelProvider: new OpenAIProvider({ apiKey }) })],
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-agentssamples. Nothing verified those blocks, so they could drift from the SDK without any check failing.Notes to reviewers
The markers upstream are scoped to exactly what each block shows, so no block needs
selectedLinesand none renders a leading// ...elision.Tracing setup stays inline because the sample wraps the exporter, tracer provider, and plugin options in a tracing-mode
switchthat would make the extracted examples incomplete. The install commands also stay inline because they have no sample source.Two sections are restructured, because the samples show in one place what the page showed in two:
Some prose shifted to match the samples' identifiers rather than the invented ones the page used —
helloWorldinstead ofhaikuAgentWorkflow, and a note that the sample Worker setsuseLocalActivity: true.Verification
Ran
yarn snipsyncagainst the merged samples source. All 17 IDs resolve, every excerpt dedents to column 0, and the committed OpenAI Agents snippets are unchanged.yarn buildpasses andvale --config .vale-ci.inireports 0 errors/warnings on the page (one pre-existing sentence-case suggestion on the "Create a Hello World Workflow" heading, untouched here).yarn check-linksshows no new failure classes for this page — the/glossary#activityfragment-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