Skip to content

Add snipsync markers to the OpenAI Agents samples - #510

Merged
brianstrauch merged 1 commit into
mainfrom
snipsync/openai-agents
Aug 19, 2026
Merged

Add snipsync markers to the OpenAI Agents samples#510
brianstrauch merged 1 commit into
mainfrom
snipsync/openai-agents

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

What was changed

Snipsync markers on the openai-agents sample files that the TypeScript OpenAI Agents SDK integration guide walks through. Markers only — no sample logic changes — with one exception noted below.

mcp/worker.ts hoists its four MCP providers into two named locals (statelessProviders, statefulProviders) before Worker.create. Behavior is identical; it gives the stateless and stateful registrations a contiguous region a marker can wrap, and names which is which.

Why?

The guide hand-maintained 16 inline TypeScript blocks that no CI job verified, so they could drift from the SDK without anything failing. The companion docs PR replaces them with snipsync blocks pulling from here.

Two details worth flagging for review:

  • Markers are scoped to exactly the code the guide shows, so no docs block needs selectedLines and none renders a leading // ... elision.
  • Markers that wrap indented code sit at that code's indent level rather than column 0. A column-0 marker zeroes the common indent prefix and suppresses snipsync's dedenting, which is the bug fixed for the Python samples in Scope google_genai snippet markers to the excerpted code samples-python#346.

typescript-openai-agents-streaming-workflow already existed and is untouched.

Checklist

  1. Closes

  2. How was this tested:

prettier --check src, tsc --noEmit, and eslint src all pass (eslint reports only the 10 pre-existing MCP SDK deprecation warnings).

Snippet resolution was verified by pointing a local snipsync.config.yaml at this working tree and running yarn snipsync from the documentation repo: all 14 new IDs resolve, every excerpt dedents to column 0, and no block renders an elision marker.

🤖 Generated with Claude Code

The TypeScript OpenAI Agents SDK integration guide hand-maintained its
code blocks, so nothing verified them against a running sample. Add
snipsync markers scoped to exactly the code that guide shows, so it can
pull from here instead.

Markers wrapping indented code sit at that code's indent level rather
than column 0, so snipsync's dedent still applies (see #346).

mcp/worker.ts hoists its MCP providers into two named locals before
Worker.create. Behavior is unchanged; it gives the stateless and stateful
registrations a contiguous region a marker can wrap, and names which is
which.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@brianstrauch
brianstrauch merged commit 8789baa into main Aug 19, 2026
22 of 23 checks passed
@brianstrauch
brianstrauch deleted the snipsync/openai-agents branch August 19, 2026 18:58
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