Skip to content

fix(openai): correct rendered-context framing for annotation-only tool imaging#123

Merged
teamchong merged 1 commit into
mainfrom
fix/gpt-rendered-context-wording
Jul 19, 2026
Merged

fix(openai): correct rendered-context framing for annotation-only tool imaging#123
teamchong merged 1 commit into
mainfrom
fix/gpt-rendered-context-wording

Conversation

@teamchong

Copy link
Copy Markdown
Owner

Salvages the still-valid part of #19 (by @rldyourmnd) and rebases it onto current main.

Why

main already fixed the double-billing that #19 originally targeted: commit 4c78363 reworked the GPT path to strip parameter annotations from the native tools[] and image only those annotations (schemaAnnotationLines), keeping each tool's name and top-level description native. That superseded #19's functional change.

What it left behind is stale framing text: CHAT_HEADER / RESPONSES_HEADER and the two pointers still tell the model the images hold "full tool/schema documentation" and that the native JSON is merely supplemental — no longer true now that only parameter annotations are imaged.

What

  • Reword the four framing constants so they match what is actually imaged: the native JSON tool definitions carry each tool's name and description and stay authoritative; the imaged parameter annotations are supplemental.
  • Export the constants and add a regression test (rendered-context wording) asserting the framing never claims "full tool" docs and always points at the native definitions.
  • No behavior change to token accounting or imaging — framing text only.

Credit

The rendered-context wording work is @rldyourmnd's from #19; the commit here is authored under their name. This PR only rebases it onto main's annotation-only design and updates the wording to describe that design accurately.

Supersedes #19 (whose functional change is already in main via 4c78363) — #19 can be closed.

Full test suite green (783 tests) + typecheck clean.

@teamchong
teamchong force-pushed the fix/gpt-rendered-context-wording branch from 0943b43 to 7e63201 Compare July 18, 2026 22:55
@teamchong
teamchong force-pushed the fix/gpt-rendered-context-wording branch from 7e63201 to 88e2884 Compare July 19, 2026 02:56
…l imaging

Align Chat and Responses framing with annotation-only tool imaging, preserving native tool definitions as authoritative. Includes output-level regressions adapted from #19.
@teamchong
teamchong force-pushed the fix/gpt-rendered-context-wording branch from 88e2884 to 98a510d Compare July 19, 2026 02:58
@teamchong
teamchong merged commit a4b40f5 into main Jul 19, 2026
1 check passed
@teamchong
teamchong deleted the fix/gpt-rendered-context-wording branch July 19, 2026 02: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