Skip to content

Scope google_genai snippet markers to the excerpted code - #346

Merged
brianstrauch merged 1 commit into
mainfrom
google-genai-snippet-ranges
Aug 10, 2026
Merged

Scope google_genai snippet markers to the excerpted code#346
brianstrauch merged 1 commit into
mainfrom
google-genai-snippet-ranges

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

The Google GenAI plugin page pulled four of these snippets with selectedLines ranges that started partway into the file, so snipsync rendered each with a leading # ... elision marker. That marker sits at column 0, which zeroes out the common indent prefix and suppresses snipsync's dedenting, so the two worker excerpts rendered indented as well.

This moves the SNIPSTART/SNIPEND markers to wrap exactly the code the page shows, so the page can drop selectedLines entirely:

  • tools/run_worker.py — the Worker construction with its activity
  • vertex_ai/run_worker.py — the vertexai=True client and plugin
  • mcp/run_worker.pyecho_session through the plugin registration
  • streaming/run_workflow.pyconsume() through the Client.connect that installs the Pydantic data converter

The streaming range was also wrong rather than just offset: it began at a dangling if inside consume() and omitted the stream.subscribe() call the surrounding prose describes.

No runtime code changes — comment lines only. uv run poe lint (ruff check, ruff format, mypy) passes.

🤖 Generated with Claude Code

The docs page for the Google GenAI plugin pulled four of these snippets
with `selectedLines` ranges that started partway into the file, so
snipsync rendered each one with a leading `# ...` elision marker. The
marker also sits at column 0, which zeroes out the common indent prefix
and suppresses snipsync's dedenting, so the worker excerpts rendered
indented as well.

Move the SNIPSTART/SNIPEND markers to wrap exactly the code the page
shows, so the page can drop `selectedLines` entirely:

- tools/run_worker.py: the Worker construction with its activity
- vertex_ai/run_worker.py: the vertexai=True client and plugin
- mcp/run_worker.py: echo_session through the plugin registration
- streaming/run_workflow.py: consume() through the Client.connect that
  installs the Pydantic data converter

The streaming range was also wrong, not just offset: it began at a
dangling `if` inside consume() and omitted the stream.subscribe() call
that the surrounding prose describes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@brianstrauch
brianstrauch merged commit 050e413 into main Aug 10, 2026
11 checks passed
@brianstrauch
brianstrauch deleted the google-genai-snippet-ranges branch August 10, 2026 17:30
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