Skip to content

feat(reborn): route Responses through ProductWorkflow - #4546

Merged
think-in-universe merged 54 commits into
mainfrom
issue-4445-reborn-responses-workflow
Jun 9, 2026
Merged

think-in-universe merged 54 commits into
mainfrom
issue-4445-reborn-responses-workflow

Conversation

@think-in-universe

@think-in-universe think-in-universe commented Jun 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds OpenAiResponsesWorkflow for non-streaming Responses create, retrieve, and cancel routes.
  • Wires /api/v1/responses, /v1/responses, retrieve, and cancel handlers through injected ProductWorkflow/projection-reader state instead of fail-closed stubs.
  • Preserves opaque resp_* refs, actor-scoped idempotency replay/conflict behavior, previous-response authorization, timeout-detach semantics, and sanitized not-found behavior for nonexistent/unauthorized/unbound refs.
  • Keeps stream: true, request tools, and tool_choice rejected before ProductWorkflow side effects; streaming remains the [Reborn] Translate projection streams to OpenAI-compatible SSE #4446 slice.
  • Updates the Reborn OpenAI-compatible API contract docs and adds caller-level route coverage.

Linked Issue

Refs #4445

Depends on #4444

Part of #3283

Validation

  • cargo fmt --all -- --check
  • git diff --check
  • cargo test -p ironclaw_reborn_openai_compat --features openai-compat-beta --ignore-rust-version
  • cargo test -p ironclaw_reborn_openai_compat_storage --all-features --ignore-rust-version

Security Impact

Yes. This touches authenticated API route behavior and cancellation. The route requires host-minted authenticated caller state, authorizes previous_response_id and retrieve/cancel refs through the opaque ref store, rejects unsupported tools/streaming before side effects, caps flattened input items before ProductWorkflow side effects, sanitizes flattened input text to prevent newline role injection, and returns the same sanitized not-found shape for nonexistent, unauthorized, or unbound refs.

Database Impact

No schema or migration changes. This uses the existing OpenAI-compatible ref store port and projection-reader seam.

Blast Radius

Limited to ironclaw_reborn_openai_compat behind openai-compat-beta, plus the Reborn OpenAI-compatible API contract doc. Streaming remains fail-closed for #4446.

Rollback Plan

Revert this PR to return Responses create/retrieve/cancel routes to their prior fail-closed 501 unsupported behavior.

Review Follow-Through

Reviewer judgment requested on the temporary projection-reader seam and the ProductWorkflow control-action acknowledgement shape for cancel. The route accepts both accepted and command-result acknowledgements for cancel while keeping create strict.


Review track: C

hanakannzashi and others added 26 commits June 4, 2026 19:48
* feat(reborn): add OpenAI-compatible product refs

* fix(reborn): validate OpenAI-compatible ref mappings

* fix(reborn): address OpenAI product refs review

* Validate durable OpenAI compat ref records

* Format OpenAI compat storage review fixes

---------

Co-authored-by: Robert Yan <mstr.raphael@gmail.com>
@github-actions github-actions Bot added scope: docs Documentation size: XL 500+ changed lines risk: low Changes to docs, tests, or low-risk modules contributor: experienced 6-19 merged PRs labels Jun 8, 2026
Base automatically changed from issue-4444-reborn-chat-completions-workflow to main June 9, 2026 10:46
…ponses-workflow

# Conflicts:
#	crates/ironclaw_reborn_composition/src/openai_compat_serve.rs
#	crates/ironclaw_reborn_composition/tests/webui_v2_serve.rs
#	crates/ironclaw_reborn_openai_compat/CLAUDE.md
#	crates/ironclaw_reborn_openai_compat/src/chat_workflow.rs
#	crates/ironclaw_reborn_openai_compat/src/handlers.rs
#	crates/ironclaw_reborn_openai_compat/src/lib.rs
#	docs/reborn/contracts/openai-compatible-api.md
Copilot AI review requested due to automatic review settings June 9, 2026 11:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@think-in-universe
think-in-universe dismissed henrypark133’s stale review June 9, 2026 11:08

Review comments are resolved

@think-in-universe
think-in-universe added this pull request to the merge queue Jun 9, 2026
@think-in-universe
think-in-universe removed this pull request from the merge queue due to a manual request Jun 9, 2026
@think-in-universe
think-in-universe merged commit 36ce10a into main Jun 9, 2026
66 checks passed
@think-in-universe
think-in-universe deleted the issue-4445-reborn-responses-workflow branch June 9, 2026 12:02
theredspoon pushed a commit to theredspoon/ironclaw that referenced this pull request Jun 21, 2026
* feat(reborn): add OpenAI-compatible API contracts

* fix(reborn): tighten OpenAI-compatible response contracts

* fix(reborn): address OpenAI compat contract review

* fix(reborn): satisfy merged main clippy

* feat(reborn): add OpenAI-compatible product refs

* fix(reborn): validate OpenAI-compatible ref mappings

* fix(reborn): address OpenAI product refs review

* feat(reborn): route chat completions through ProductWorkflow

* fix(reborn): simplify chat completion timestamps

* fix(reborn): use explicit ProductWorkflow submit door

* test(reborn): stabilize subagent cancellation propagation

* Validate durable OpenAI compat ref records

* Fix chat completions idempotency validation

* Format OpenAI compat storage review fixes

* feat(reborn): add OpenAI-compatible product refs (nearai#4489)

* feat(reborn): add OpenAI-compatible product refs

* fix(reborn): validate OpenAI-compatible ref mappings

* fix(reborn): address OpenAI product refs review

* Validate durable OpenAI compat ref records

* Format OpenAI compat storage review fixes

---------

Co-authored-by: Robert Yan <mstr.raphael@gmail.com>

* Address chat completions review comments

* Persist chat completion idempotency replay metadata

* Export OpenAI compat ack recording request

* Persist OpenAI compat accepted workflow acks

* feat(reborn): route responses through ProductWorkflow

* fix(reborn): declare compat storage chrono dependency

* fix(reborn): resolve chat completions review feedback

* fix(reborn): resolve chat completions review feedback

* fix(reborn): keep responses cancel within adapter boundary

* fix(openai-compat): address chat workflow review comments

* fix(openai-compat): address responses handler review comments

* fix(openai-compat): persist responses replay state

* test(openai-compat): cover responses review paths

* fix(openai-compat): annotate optional responses router state

* test(product-adapters): cover cancel run payload validation

* fix(openai-compat): address chat ref store review

* fix(reborn): resolve chat projections through workflow

* fix(reborn): close responses workflow review gaps

* test(reborn): cover responses wait cancellation

* feat(reborn): wire OpenAI chat completions route

* fix(reborn): wire OpenAI responses composition

* fix(reborn): centralize chat body validation

* fix(reborn): centralize responses body validation

* fix(reborn): keep OpenAI compat off turns

---------

Co-authored-by: Coffee <zjchen1234@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: experienced 6-19 merged PRs risk: low Changes to docs, tests, or low-risk modules scope: dependencies Dependency updates scope: docs Documentation size: XL 500+ changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants