Skip to content

fix(conversations): model official input and output item unions - #747

Draft
leseb wants to merge 5 commits into
praxis-proxy:mainfrom
leseb:leseb/issue-567-conversation-item-unions
Draft

fix(conversations): model official input and output item unions#747
leseb wants to merge 5 commits into
praxis-proxy:mainfrom
leseb:leseb/issue-567-conversation-item-unions

Conversation

@leseb

@leseb leseb commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #567.

  • Replace opaque-object Conversation item contracts with the official OpenAI InputItem and ConversationItem unions using oneOf variants with type discriminators.
  • Generate item schemas from the projected OpenAI specification via a new xtask command (sync-item-contracts), compiled at startup with jsonschema for runtime validation.
  • Validate items at the owned API boundary: InputItem on create, ConversationItem on normalize/append-back, rejecting structurally invalid items with OpenAI-style error responses.
  • Reconcile with aligned request contracts from fix(conversations): align create and update request contracts #625: add nullable_vec deserializer for null-as-empty items, remove dead nullable_initial_items_schema, fix integration test to include required OutputTextContent fields.

Test plan

  • make lint passes (clippy, fmt, deps, docs, examples)
  • make test passes (2534 unit + 457 integration + schema tests)
  • Integration test append_back_persists_items_after_response fixed and passing
  • Conformance report updated with refreshed drift counts

@leseb
leseb requested review from a team and aslakknutsen August 14, 2026 09:46
leseb added 3 commits August 14, 2026 11:52
Replace the broad opaque Conversation item schema with the official OpenAI InputItem and ConversationItem unions at locally owned API boundaries.

Generate deterministic recursive item contracts from the pinned OpenAI specification, compile runtime validators from the same artifact, validate accepted inputs and normalized stored outputs, and merge the official discriminator-based components into the generated OpenAPI document. Cover representative messages, tool calls, tool outputs, reasoning items, supported extensions, and malformed or unknown variants, then refresh the conformance report.

Closes praxis-proxy#567

Signed-off-by: Sébastien Han <seb@redhat.com>
Regenerate the Conversations conformance report after the include-projection changes landed on main. Remove stale query-parameter drift for item endpoints and record the current item-union results: two exact operations, four request-drift operations, and four response-drift operations.

Closes praxis-proxy#567

Signed-off-by: Sébastien Han <seb@redhat.com>
Resolve rebase conflicts between the request-contract alignment
(praxis-proxy#566/praxis-proxy#625) and the item union modeling (praxis-proxy#567). Removes the dead
nullable_initial_items_schema, adds a null-to-default deserializer
for create items, fixes the integration test to include required
OutputTextContent fields, and drops unused imports.

Signed-off-by: Sébastien Han <seb@redhat.com>
@leseb
leseb marked this pull request as draft August 14, 2026 09:52
@leseb
leseb force-pushed the leseb/issue-567-conversation-item-unions branch from d92dae5 to ac19b50 Compare August 14, 2026 09:56
leseb added 2 commits August 14, 2026 12:01
The jsonschema crate brings in borrow-or-share which uses the MIT-0
(MIT No Attribution) license. Add it to the deny.toml allowlist.

Signed-off-by: Sébastien Han <seb@redhat.com>
…ovement

Signed-off-by: Sébastien Han <seb@redhat.com>
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.

Model official Conversation input and output item unions

1 participant