Repository navigation
fix(examples): show the helpers each docs region calls - #187
Merged
marcusschiesser merged 2 commits intoOct 21, 2026
Merged
Conversation
…ured output A reconnect behind the replay buffer answers with one MESSAGES_SNAPSHOT instead of the tool-call frames, which the read-stream snippet ignored, so a completed submit_result could be lost. A from_snapshot helper outside the docs region replaces the collected arguments with the snapshot's tool calls, as the JS, Rust and Swift snippets do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Move from_snapshot into the structured-output read-stream region and replace hidden app placeholders (send_event_to_browser, save_agent_binding, render) with minimal stubs inside the regions that call them. AGENTS.md states the rule for later regions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
marcusschiesser
deleted the
marcusschiesser/structured-output-snapshot
branch
October 21, 2026 12:07
This branch was successfully deployed
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.
docs.introspection.dev renders the
# #region docs:<id>blocks through<SdkCode>at pinned tags (introspection-docs#248). At v0.29.0 several Python regions call helpers defined outside the region, so the docs show calls to code the reader never sees. This PR makes every region show each helper it calls, and fixes the original Codex finding on the docs PR (https://github.com/introspection-org/introspection-docs/pull/248#discussion_r4335902007, P2).Regions changed
patterns/structured-output/read-streampatterns/structured_output.pyMESSAGES_SNAPSHOT(a reconnect past the replay buffer sends the run so far instead of the frames, so a finishedsubmit_resultwas lost). The newfrom_snapshothelper is defined inside the region, before its use.patterns/add-to-your-app/start-taskpatterns/add_to_your_app.pysave_agent_bindingandsend_event_to_browserinside the region, each under a# Your app's code: ...comment. The module-levelOrdersstore is gone;start_taskreturns the binding tomaininstead.patterns/add-to-your-app/reconnectpatterns/add_to_your_app.pysend_event_to_browserinside the region.reference/python/reattachreference/python_sdk.pyrenderinside the region.Region ids and markers are unchanged.
Audit
Every
docs:region in the repo (22 files, all Python) was checked with an AST script for calls to functions, classes, methods or closures the example file defines outside the region. Only the four regions above had any. The remaining hits were SDK methods that share a name with the enclosing function (runs.resume,run.cancel,logs.feedback), not hidden helpers.Rule
AGENTS.md (Examples) now says: a docs region must show every helper it calls that the example file defines. SDK work (stream parsing, snapshot recovery, text accumulation) goes inside the region before its use; the reader's own app code (
render,save_agent_binding, ...) gets a minimal stub inside the region under a one-line# Your app's codecomment.Example-only change, no SDK API change.
Checks run locally:
ruff format,ruff check,ty check,prek run --all-files,scripts/check_examples.py(compiles, imports resolve, regions paired).🤖 Generated with Claude Code