Skip to content

Use JSON field names in Defined output instructions - #1590

Open
Twiink wants to merge 1 commit into
tmc:mainfrom
Twiink:codex/20261128-defined-json-tags
Open

Twiink wants to merge 1 commit into
tmc:mainfrom
Twiink:codex/20261128-defined-json-tags

Conversation

@Twiink

@Twiink Twiink commented Nov 28, 2026

Copy link
Copy Markdown

A field tagged json:"title,omitempty" is currently described to the model as title,omitempty, while Parse expects title. A tag such as json:",omitempty" also loses the Go field name, and json:"-" exposes a field the JSON decoder will ignore.

Read the name before the tag options, fall back to the Go field name when it is empty, and skip the exact - tag. This applies to nested generated interfaces too.

Two regression tests fail on the original source. They check the public format instructions for ordinary and nested structures and retain a public Parse round-trip for the described field names.

Validation: outputparser, chains and agents pass with -race; repository-wide golangci-lint passes with 0 issues. This branch retains the default branch's dependency versions; existing PR CI reports GO-2026-6278 in the WebSocket dependency, unrelated to this output-parser change.

This branch has not been deployed

No deployments
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