Skip to content

test(ai): lock JSON mode forwarding for ToolLoopAgent object output#12592

Open
giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone:codex/issue-12491-json-mode-regression
Open

test(ai): lock JSON mode forwarding for ToolLoopAgent object output#12592
giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone:codex/issue-12491-json-mode-regression

Conversation

@giulio-leone
Copy link

@giulio-leone giulio-leone commented Feb 14, 2026

Summary

  • add regression tests proving ToolLoopAgent.generate() forwards Output.object() as responseFormat: json
  • add regression tests proving ToolLoopAgent.stream() forwards Output.object() as responseFormat: json
  • this complements existing coverage already present for generateText, streamText, and streamObject

Context

Issue #12491 reports missing provider-level JSON mode with generateText + Output.object(). This PR hardens the agent layer to ensure no regression in the agent.generate() / agent.stream() path.

Validation

  • pnpm --filter ai exec vitest --config vitest.node.config.js --run src/agent/tool-loop-agent.test.ts
  • pnpm --filter ai exec eslint src/agent/tool-loop-agent.test.ts
  • pnpm --filter ai type-check
  • repeated the same validation suite twice consecutively with zero failures

Closes #12491

Attribution request

If this pull request is merged, I would be grateful if contributor credit could be included in the related changelog or release notes for implementing this fix (@g97iulio1609).

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.

generateText + Output.object() doesn't use provider-level JSON mode like generateObject

1 participant