Skip to content

[release/0.7] RSPEED-3958: Don't attach a conversation to stateless /v1/responses requests - #3286

Merged
tisnik merged 1 commit into
lightspeed-core:release/0.7from
asimurka:backport-stateless-conversation-to-0.7
Nov 19, 2026
Merged

tisnik merged 1 commit into
lightspeed-core:release/0.7from
asimurka:backport-stateless-conversation-to-0.7

Conversation

@asimurka

Copy link
Copy Markdown
Contributor

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.

PendingTurn.for_request() treated any request with omit_conversation as compacted and required its original input; accept a store=false request without one, since its turn is never stored.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library [pyproject.toml + uv.lock]
  • Bump-up dependent library [requirements.*.txt for Konflux]
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

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

  • Assisted-by: (e.g., Claude, CodeRabbit, Ollama, etc., N/A if not used)
  • Generated by: (e.g., tool name and version; N/A if not used)

Related Tickets & Documents

  • Related Issue #
  • Closes #

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

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

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.

PendingTurn.for_request() treated any request with omit_conversation as
compacted and required its original input; accept a store=false request
without one, since its turn is never stored.
@coderabbitai

coderabbitai Bot commented Nov 19, 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

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:56 AM UTC · Completed 10:12 AM UTC

Commit: f27cf70 · View workflow run →

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

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 19, 2026
@fullsend-ai-review

Copy link
Copy Markdown

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Small, focused change (3 files, 87 lines) with adequate test coverage and no protected or security-sensitive paths, but the modified files show high author contention (up to 10 distinct authors) and notable regression history (9 fix/revert commits in 90 days), elevating git history risk while overall composite remains moderate.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [incomplete-doc] docs/devel_doc/responses.md:676 — The “No context provided” conversation handling rule states “LCORE creates a new, empty conversation and assigns the new turn to it” without noting the store=false exception introduced by this PR. When store=false with no conversation or previous_response_id (stateless request), the auto-created conversation is no longer attached to OGX (omit_conversation=True) and no topic summary is generated. The documented behavior is now incomplete for the stateless case.
    Remediation: Add a qualifier to the “No context provided” bullet noting that when store=false, the auto-created conversation is used only for identity in the response — it is not attached to OGX and no topic summary is generated.

Low

  • [incomplete-doc] docs/devel_doc/responses.md:635 — The generate_topic_summary extension is documented as “When set to true and a new conversation is created, a topic summary is automatically generated and stored in conversation metadata.” This PR forces generate_topic_summary to False for stateless requests regardless of the client-provided value, which is an undocumented behavioral override.

Info

  • [missing-test] tests/unit/app/endpoints/test_responses.py — The new test only verifies the stateless behavior for non-streaming requests. The streaming path shares the same stateless detection logic (computed before the streaming/non-streaming fork), so the core logic is covered. A streaming-specific test case would increase confidence.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

1 finding(s) below the low severity threshold were not posted.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

@asimurka
asimurka requested a review from tisnik November 19, 2026 10:20

@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 merged commit 79d9c23 into lightspeed-core:release/0.7 Nov 19, 2026
58 of 60 checks passed
@fullsend-ai-retro

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

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 1:25 PM UTC · Completed 1:35 PM UTC

Commit: f27cf70 · View workflow run →

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

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #3286 — Backport of stateless /v1/responses fix to release/0.7

Timeline

  1. ~Nov 10 — Original fix PR Don't attach a conversation to stateless /v1/responses requests #3190 merged to main by owtaylor. Two human reviewers (asimurka, tisnik) approved. No fullsend-ai review agent ran on that PR.
  2. Nov 19, 09:44 UTC — Backport PR [release/0.7] RSPEED-3958: Don't attach a conversation to stateless /v1/responses requests #3286 opened by asimurka targeting release/0.7. Branch: backport-stateless-conversation-to-0.7. 3 files changed, 86 additions, 1 deletion.
  3. Nov 19, 09:44 UTC — CodeRabbit skipped review (auto-reviews disabled on non-default branches).
  4. Nov 19, 09:56–10:12 UTC — Review agent ran full review (claude-opus-4-6, effort: high, cost: $7.57, 16 min). Dispatched from fullsend-ai/agents@v0.53.0. Verdict: CHANGES_REQUESTED with 3 findings:
    • Medium incomplete-doc — docs/devel_doc/responses.md:676 doesn’t mention the store=false exception.
    • Low incomplete-doc — docs/devel_doc/responses.md:635 undocumented override of generate_topic_summary.
    • Info missing-test — only non-streaming path tested (agent acknowledged streaming shares the same logic).
  5. Nov 19, 13:13 UTC — Human reviewer tisnik approved with “LGTM.” PR merged immediately. Agent’s CHANGES_REQUESTED findings were not addressed.

Analysis

Review quality was technically sound but contextually misaligned. The agent’s doc-gap findings are factually correct — docs/devel_doc/responses.md does not document the new store=false stateless behavior. However, all findings target documentation, not code correctness. The code change itself is a well-structured bug fix with parametrized tests covering 4 cases. The agent correctly identified no code-level problems.

The CHANGES_REQUESTED verdict was disproportionate. Blocking a release-branch production bug fix for documentation gaps that weren’t required on the original main merge is counter to the team’s priorities. The human reviewer’s override was pragmatically correct.

Backport context was not leveraged. The agent treated this as a brand-new PR, spending $7.57 on a full high-effort review. The original PR #3190 was already reviewed and merged by two human reviewers. A backport-aware review could have been lighter.

No new proposals filed — existing issues cover these themes

  • Backport detection: fullsend-ai/fullsend#3679 (open, priority/medium) proposes that the review agent detect cherry-pick/backport PRs and incorporate prior review findings. This retro provides additional evidence: PR [release/0.7] RSPEED-3958: Don't attach a conversation to stateless /v1/responses requests #3286 received a full $7.57 review for a 3-file backport of an already-reviewed change.
  • Verdict proportionality: fullsend-ai/fullsend#2115 (open) proposes using COMMENT instead of CHANGES_REQUESTED for human-authored PRs with only medium/low findings. This retro is a clear supporting case — the CHANGES_REQUESTED verdict was overridden by the human reviewer.
  • Scope-based effort reduction: fullsend-ai/fullsend#6891 (open, priority/medium) proposes a pre-flight scope heuristic to reduce review effort/model for small PRs. A backport of 86 lines across 3 files is a good candidate for reduced effort.

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

Labels

risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants