Skip to content

Don't attach a conversation to stateless /v1/responses requests - #3191

Merged
tisnik merged 1 commit into
lightspeed-core:konflux/references/release/0.6from
owtaylor:stateless-responses-no-conversation-0-6
Nov 10, 2026
Merged

tisnik merged 1 commit into
lightspeed-core:konflux/references/release/0.6from
owtaylor:stateless-responses-no-conversation-0-6

Conversation

@owtaylor

@owtaylor owtaylor commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

See #3190 for main branch - this is a 0.6 backport

Description

A /v1/responses request with store=false and no conversation or previous_response_id comes from a stateless client that resends the full history as input on every request (e.g. a Chat Completions to Responses proxy). lightspeed-stack still auto-created a conversation and passed it to OGX, which then copied the entire input into the conversation after the response. OGX adds those items with a single AddItemsRequest, which is limited to 20 items, so once the history grew past that every request failed after streaming the output:

  1 validation error for AddItemsRequest
  items
    List should have at most 20 items after validation, not 22

For such requests, set omit_conversation so the conversation parameter isn't sent to OGX, and skip topic summary generation, whose result is only used when the turn is stored.

Note:

  • This does not fix requests with store: true that add more than 20 items at once. That would be a separate thing, and would require a change to OGX.
  • Not creating a conversation at all would require making conversation optional in many places.

Type of change

  • Bug fix

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Generated by: Claude Opus 5.5

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • New unit test: test_stateless_request_omits_conversation_and_topic_summary
    (tests/unit/app/endpoints/test_responses.py). Existing unit tests pass.
  • To reproduce manually:
    • Stand up a lightspeed-stack instance
    • POST to /v1/responses with store: false, no conversation/previous_response_id,
      and 20+ input items (e.g. a user message plus 10 function_call/function_call_output pairs)
    • Before: the stream ends with 1 validation error for AddItemsRequest ... at most 20 items;
      after: response.completed
  • This was tested with Vertex AI (Gemini) and Ollama backends

A /v1/responses request with store=false and no conversation or
previous_response_id comes from a stateless client that resends the full
history as input on every request (e.g. a Chat Completions to Responses
proxy). lightspeed-stack still auto-created a conversation and passed it
to Llama Stack, which then copied the entire input into the conversation
after the response. Llama Stack adds those items with a single
AddItemsRequest, which is limited to 20 items, so once the history grew
past that every request failed after streaming the output:

  1 validation error for AddItemsRequest
  items
    List should have at most 20 items after validation, not 22

For such requests, set omit_conversation so the conversation parameter
isn't sent to Llama Stack, and skip topic summary generation, whose
result is only used when the turn is stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@tisnik
tisnik requested a review from asimurka November 10, 2026 08:01

@asimurka asimurka 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.

LGTM

@tisnik tisnik 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.

LGTM

@tisnik

tisnik commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test

@tisnik
tisnik merged commit 7058821 into lightspeed-core:konflux/references/release/0.6 Nov 10, 2026
36 of 41 checks passed
@fullsend-ai-retro

fullsend-ai-retro Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 9:36 AM UTC · Completed 9:49 AM UTC

Commit: dff9585 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.58

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #3191 — Backport bug fix for stateless /v1/responses conversation attachment

Workflow type: Human-authored backport (PR #3190 on main → PR #3191 on konflux/references/release/0.6).

Timeline:

  1. 2026-11-09T22:36Z — PR Don't attach a conversation to stateless /v1/responses requests #3190 created on main by owtaylor (Owen Taylor), fixing a bug where stateless /v1/responses requests auto-created conversations, causing failures past OGX's 20-item AddItemsRequest limit.
  2. 2026-11-09T22:45Z — PR Don't attach a conversation to stateless /v1/responses requests #3191 created as backport to konflux/references/release/0.6.
  3. 2026-11-10T08:10–08:26Z — Two human reviewers approved both PRs with LGTM.
  4. 2026-11-10T09:29Z — PR Don't attach a conversation to stateless /v1/responses requests #3191 merged (backport merged while Don't attach a conversation to stateless /v1/responses requests #3190 on main remains open).

Agent routing: Correct. The dispatch workflow detected REVIEW_STATE: approved and correctly skipped agent review. No triage, code, review, or fix agents were dispatched. CodeRabbit auto-review was skipped on this non-default branch.

CI status: 4 pre-existing failures on the release/0.6 branch, none introduced by this PR:

Evidence for existing issues:

Overall assessment: This was a clean, well-executed human workflow. The bug fix is well-structured with appropriate test coverage. Agent routing decisions were correct. The main concern is the degraded CI signal on the release branch, which reduces value for both human and automated review.

Proposals filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants