fix(agent): stabilize research structured output - #159
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
iamjr15
added a commit
that referenced
this pull request
Aug 4, 2026
## Why The production trace after PR #159 proved that Anthropic native structured output was active, but query passes generated 11-23 exhaustive claims and exhausted the response budget before emitting required fields. Responses were valid JSON prefixes cut off mid-claim or before `summary`. ## What changed - Bound each query pass to 1-6 concise claims and 1-3 exact provider citations per claim. - Prompt the model to produce 4-6 synthesis-ready claims instead of restating the whole evidence pack. - Bound synthesis to 16 consolidated claims and 4 source IDs per claim. - Give the final synthesis an explicit 8,192-token allowance while keeping the report below 2,000 words. - Keep all strict Exa/Firecrawl provenance validation in place. No database, migration, dependency, environment, or deployment-topology changes. ## Verification - `pnpm lint` - `pnpm typecheck` - `pnpm turbo build --force` - `pnpm deadcode` - `pnpm architecture:check` - `pnpm turbo skills:build` After deployment, production QA will repeat natural-language and explicit-tool research flows and validate PDF generation, viewing, download, refresh persistence, and `/` file recall.
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.
Why
Production research runs reached the evidence pass but every nested structured-output call returned an empty object. The installed AI SDK does not yet identify
claude-sonnet-5as natively structured-output capable, so its automatic fallback used a synthetic JSON response tool that produced{}.What changed
outputFormatstructured output for research query and synthesis passes.No database, migration, dependency, environment, or deployment-topology changes.
Verification
pnpm lintpnpm typecheckpnpm turbo build --forcepnpm deadcodepnpm architecture:checkpnpm turbo skills:buildProduction browser QA will be run after the Cloudflare deployment: natural-language research intent, PDF generation, project persistence, browser viewing, download validation, refresh persistence, and
/file recall.