Repository navigation
fix(sse): keep Responses continuity when input would ship empty - #14673
diegosouzapw merged 2 commits into
Conversation
|
Clean fix for both sides of the empty-input GitHub Copilot 400 — nice touch mirroring the |
GitHub Copilot /responses rejects a body with neither non-empty input nor previous_response_id/prompt/conversation. Chat→Responses translation can emit input:[] (system-hoist, empty messages, orphan filter) while responsesStatePolicy auto mode strips previous_response_id, shipping neither field. - Inject a placeholder user item in toResponses when input is empty and no continuity field is present (mirrors the reverse-direction guard in openai-responses.ts / 9router#419). - Under auto mode, keep previous_response_id when input is empty so the only continuity field is never stripped; explicit strip mode still wins. - Pin both paths with unit tests, including the id-preserving continuation case.
f8d5954 to
8e168a0
Compare
|
Rebased onto Local verification (green)
CI failures — all base-red inherited (
|
| Job | Failure | Why not ours |
|---|---|---|
| API Route Typecheck | auggie.ts TS2769/TS18047, projectCombo.ts TS2459/TS2724 |
Not in this diff |
| Docs Gates | check:env-doc-sync: DEEP_HEALTH_CHECK_ENABLED missing from .env.example |
Not in this diff |
| Unit Tests 1–4 | e.g. qwen38-max-bare-id-alias.test.ts, credential-path map deepEqual |
Not in this diff |
| Fast Quality Gates | gates deps file-size mutation-test-coverage open-sse-typecheck typecheck:core |
Base tip red (see #14547) |
responses-handler.test.ts keepalive assertion |
expects bare {"type":"response.in_progress"}; base emits #14330 frame with sequence_number+response |
Reproduced on pure base checkout @ 7d23bcf8ec |
Green here: Vitest, No new ESLint warnings, Merge integrity, Change Classification, semgrep, semgrep-cloud.
Please merge only after base-red clears (#14547) or with explicit operator override — do not chase these failures in this PR.
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2cf2521
into
diegosouzapw:release/v3.8.51
Summary
inputwhen chat→Responses translation would otherwise shipinput: []with no conversation/continuity field (GitHub Copilot default chat 400:One of input or previous_response_id or '''prompt''' or '''conversation''' must be provided.).autoResponses state policy, keepprevious_response_idwheninputis empty (explicitstripmode still strips).Root cause: chat→Responses translation can emit
input: []whileresponsesStatePolicy(modeauto+ store-off) stripsprevious_response_id, leaving a body with neither field. Reverse direction already had a placeholder guard.Test plan
responses-state-policy.test.tskeep-on-empty, newtranslator-openai-responses-empty-input-github-400.test.ts)npm run test:vitest— 482/482 PASSchat-pipeline.test.ts— 29/29 PASSeslinton changed files — 0 errorsFiles
open-sse/translator/request/openai-responses/toResponses.ts— placeholder injectopen-sse/utils/responsesStatePolicy.ts— keepprevious_response_idwhen input empty under auto