Skip to content

Add bounded typed-answer repair and private result examples - #6214

Open
markstuart-oai wants to merge 12 commits into
markstuart/sdk-controls-07-approved-outputfrom
markstuart/sdk-controls-08-typed-large-results
Open

markstuart-oai wants to merge 12 commits into
markstuart/sdk-controls-07-approved-outputfrom
markstuart/sdk-controls-08-typed-large-results

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

A review agent can return a correctly typed verdict with zero supporting evidence, making the decision unreliable. Its evidence report may be too large or private to send, and a failed report read can still expose sensitive exception text.

Summary

The repair example uses the existing final_output_policy to allow one more candidate. A second invalid verdict raises RepairLimitError. Malformed JSON fails before final_output_policy runs. A separate helper in this example handles that case with at most two fresh, tool-free runs. These are not automatic retries. Rejected values may remain in private history.

#6120 already supplies the private store and owner checks. The additional change to this example prevents local source errors from leaking into model history by using a fixed message. Neither change adds an SDK runtime API.

Run both offline.

uv run python examples/basic/typed_answer_repair.py
uv run python examples/mcp/bounded_tool_output/main.py

Look for a corrected verdict after two candidates, then warning counts of 20 and 8 with private retrieval.

Parent #6213. Merge #6120 first and retain only this PR's additions to its recipe.

Test plan

Repair tests passed for candidate limits, schema retries and provider cleanup. Private-result tests passed for authorization, revocation and exclusion of private reports and local source errors from history.

Issue number

None.

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

@markstuart-oai
markstuart-oai requested review from a team, rm-openai and seratch as code owners November 24, 2026 07:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T08:22:14.347360Z c43b1ad New commits
🔒 Security Review ✅ Completed 2026-11-24T08:23:19.095430Z c43b1ad New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes for default-provider cleanup in the typed repair helper. Reviewed bounded semantic/schema retries, private report authorization and output shaping, failure handling, examples and tests. The new helper has an ownership issue on its supported string/default-model path; see inline finding.

Hosted CI at review: 17 passed, 2 still running. Static review only; no candidate code or tests executed.

Hosted CI update (2026-11-24 07:42 UTC): 19 passed, 2 skipped; no checks remain pending in the current rollup. The provider-cleanup request-changes finding remains. No local tests were run.

Comment thread examples/basic/typed_answer_repair.py Resolved

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after static re-review and an independent review. The repair helper now supplies a config dictionary for its default provider, preserving Runner cleanup ownership, and copies caller configuration without taking ownership of its provider. Stream draining is shielded and joins producer/provider cleanup before propagating cancellation, including repeated cancellation and eager task startup. Reviewed success, failure and cancellation coverage in both modes, tracing isolation, bounded repair behavior and inherited fixes. The prior provider-cleanup finding is addressed.

Hosted CI at review: {"SUCCESS":16,"IN_PROGRESS":3}. Pending checks remain under follow-up. No candidate code or local tests executed.

Hosted CI follow-up (2026-11-24 08:32 UTC): all checks at this reviewed commit are complete: 19 passed and 2 skipped, with no failures. The pending CI follow-up is resolved. No candidate code or local tests executed.

This branch has not been deployed

No deployments
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