Skip to content

Show the sentence inside a reply the model wrote as a JSON object - #59

Merged
TechNomadCode merged 2 commits into
mainfrom
fix/unwrap-json-reply
Oct 26, 2026
Merged

TechNomadCode merged 2 commits into
mainfrom
fix/unwrap-json-reply

Conversation

@TechNomadCode

Copy link
Copy Markdown
Owner

On staging (2026-10-26), after one search for "Add grocery delivery to the PRD.", gpt-oss-120b wrote its whole reply as {"question":"Should the app support ordering items for grocery delivery directly from the shared list?"}, and the chat showed it as is.

  • A reply with no tool call whose whole text is a JSON object of one non-empty text field, bare or in a code fence, now becomes that text (unwrappingJsonReplies in src/server/ai/cloudflare.ts). Anything else passes as it came.
  • The staging reply is replayed in tests/unit/cloudflare.test.ts, with seven cases that must stay untouched.
  • src/server files changed: ai/cloudflare.ts (the fix) and AGENTS.md (its note). Since the browser sends the unwrapped text back, earlier answers reach the model as the sentence too.
  • Our plan notes what staging showed.

Checks: npm run verify passed locally (600 unit tests and the production build).

TechNomadCode and others added 2 commits October 26, 2026 14:46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TechNomadCode
TechNomadCode merged commit 42fcca6 into main Oct 26, 2026
5 checks passed
@TechNomadCode
TechNomadCode deleted the fix/unwrap-json-reply branch October 26, 2026 13: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.

1 participant