Pull TypeScript OpenAI Agents code from the samples repo - #5137
Draft
brianstrauch wants to merge 1 commit into
Draft
Pull TypeScript OpenAI Agents code from the samples repo#5137brianstrauch wants to merge 1 commit into
brianstrauch wants to merge 1 commit into
Conversation
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>
|
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.
Comment on lines
+375
to
378
| mcpServerProviders: [...statelessProviders, ...statefulProviders], | ||
| }), | ||
| ], | ||
| ``` |
| new OpenAIAgentsPlugin({ | ||
| modelProvider: new OpenAIProvider({ apiKey }), | ||
| modelParams: { useLocalActivity: true }, | ||
| interceptorOptions: { useOtelInstrumentation, addTemporalSpans: true }, |
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.Blocked on temporalio/samples-typescript#510, which adds the markers. Draft until that merges —
yarn snipsynccan'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
selectedLinesand none renders a leading// ...elision.Three blocks are deliberately not converted:
switchthat would obscure the API.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
Snippet resolution was checked by temporarily pointing
snipsync.config.yamlat a local clone of the samples branch and runningyarn snipsync: all 17 IDs resolve and every excerpt dedents to column 0. That config change is not part of this PR. Re-runyarn snipsynconce #510 merges; the committed content should be 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