Skip to content

test(effect): pin empty structuredOutputText in json generate - #392

Merged
ThomasK33 merged 1 commit into
mainfrom
effect-structured-output-empty-test
Oct 25, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
effect-structured-output-empty-test

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Follow-up F49 from #388. Test-only: no src change.

What

One unit test in packages/effect/test/language-model.test.ts, next to the existing structuredOutputText test. A JSON generate call (generateObject) through fromModel gets a result with valid JSON in its text parts and structuredOutputText: "". The test expects a StructuredOutputError whose responseText is "". That proves the bridge passed the empty string and did not fall back to the text parts.

Validation

  • Mutation check: I changed the bridge to result.structuredOutputText || undefined (treats "" as unset). The new test failed. I reverted the change before committing.
  • Node 26.12.1, pnpm 11.28.8: pnpm install --frozen-lockfile, pnpm -r build, pnpm check (exit 0), pnpm -r test (exit 0; effect 100 passed, live e2e skipped).

Verification tier: verified against source (unit test with a fake model). No live e2e (test-only change).


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

A JSON generate call whose result sets structuredOutputText to ""
must parse "" (a deliberate selection), not fall back to the text
parts. The new unit test gives valid JSON in the text parts and an
empty structuredOutputText, and expects a StructuredOutputError whose
responseText is "". A truthiness check in the bridge fails the test.

Signed-off-by: Thomas Kosiewski <tk@coder.com>

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_

Change-Id: Ibba7c5785a9482416e0173d0b49495ee469599c4
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-25T19:25:24.638195Z bed8ef8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: bed8ef8c89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: bed8ef8c89

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 5096fb6 Oct 25, 2026
6 checks passed
@ThomasK33
ThomasK33 deleted the effect-structured-output-empty-test branch October 25, 2026 19:27
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