Skip to content

fix(responses,google): deliver structured output to routed chat models and honor effort ladders - #1137

Open
lidge-jun wants to merge 9 commits into
codex/260806-stack04-rollout-boundsfrom
codex/260806-stack05-structured-output
Open

fix(responses,google): deliver structured output to routed chat models and honor effort ladders#1137
lidge-jun wants to merge 9 commits into
codex/260806-stack04-rollout-boundsfrom
codex/260806-stack05-structured-output

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Routed openai-chat models now receive structured-output requests instead of silently returning prose, and any Google model with a declared effort ladder gets its thinkingLevel sent.

Structured output. parseRequest reduced the Responses text.format object to a boolean (_structuredOutput), so the schema, name, and strict flag were discarded at the parser and no adapter could forward them — src/adapters/openai-chat.ts had no response_format handling at all. The format now rides options.textFormat and is re-nested under json_schema on the Chat wire, the inverse of responseFormatToText. A caller that asks for a schema and gets prose back will try to JSON.parse it, which is the failure this removes.

Gemini effort. thinkingLevel was sent for a narrow model set only; it now follows any declared effort ladder, with the docs stating that both reasoningEfforts and modelReasoningEfforts assert capability and that CCA uses its envelope-specific path.

Attribution

Both fixes are @DevMello's (Pranav Yerramaneni) work, from #985 and #978. Seven of the nine commits here are cherry-picked with their authorship intact; the two I authored carry Co-authored-by: Pranav Yerramaneni.

One correction on top of #985: its json_schema branch was guarded by textFormat.schema !== undefined, so a schema-less json_schema fell through and no response_format was sent — silently reproducing the original defect on a narrower input. The guard now sits on the schema member instead of the branch, with a regression test asserting response_format.type === "json_schema" is still sent when no schema is supplied.

#985 and #978 are left open for the author. Planning unit: devlog/_plan/260806_stacked_bug_campaign/ (phases 090, 100).

Stack 5 of the 260806 attribution campaign, stacked on #1136.

Verification

  • bun test tests/openai-chat-hardening.test.ts tests/responses-parser.test.ts tests/chat-completions-endpoint.test.ts tests/google-hardening.test.ts — 129 pass, 0 fail
  • bun run typecheck — exit 0
  • bun run privacy:scan — passed
  • bun run test (full) — exit 0
  • Docs build — 221 pages built
  • Full suite also passed the repository prepush gate on push

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

DevMello and others added 9 commits August 6, 2026 23:51
Keep json_schema routing active when the schema member is omitted.

Source: PR #985.

Co-authored-by: Pranav Yerramaneni <pranavy2008@gmail.com>
Document provider-wide and per-model capability assertions and cover the provider-wide non-image path.

Source: PR #978.

Co-authored-by: Pranav Yerramaneni <pranavy2008@gmail.com>
@github-actions github-actions Bot added the bug Something isn't working label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants