Repository navigation
fix(sse): fail Zed streams without false success - #12455
Merged
diegosouzapw merged 6 commits intoSep 3, 2026
Merged
Conversation
…zed-stream-error-boundary
…zed-stream-error-boundary
diegosouzapw
marked this pull request as ready for review
September 3, 2026 23:58
linhdmn
added a commit
to linhdmn/omniroute-INITIAL_PASSWORD-fix
that referenced
this pull request
Sep 4, 2026
…om release/v3.8.51 All 15 failing tests across shards 1-4 reproduce on pristine base c41ec7f; this drains them at the source so every PR stops inheriting them. Sanitizer pipeline (regressions introduced by 2265ce7's path-span rewrite): - errorPathRedaction: credential assignments are now redacted BEFORE path spans resolve (errorSanitization runs an early redactLabeledCredentialAssignments pass in sanitizeErrorMessageWithStackPolicy), and the span scanner treats sanitizer output as prose boundaries — 'label=[REDACTED]', bare '[REDACTED]', and 'label:' introducers (CREDENTIAL_LABEL_BOUNDARY mirrors BLOCKED_KEYS) stop the fail-closed span instead of being swallowed with it. 'with' joins CLEAR_PROSE_BOUNDARIES. Fixes: error-sanitizer-sk-key-qv45 (AIza 33-char fixture), huggingchat transport + stream boundaries, stream-handler public boundary, dashboard request-failed redaction, tunnel canary. - credentialPatterns: google pattern /AIza[0-9A-Za-z_-]{35}/ → {20,} to match the GHSA-qv45-56jc-4wmj test oracle (the qv45 fixture key is 33 chars after AIza; the {35} form missed it and redactSensitiveErrorText returned it verbatim). - error.ts SAFE_PUBLIC_ERROR_IDENTIFIERS: + huggingchat_generation_error, zai_stream_error — both were passing through projectPublicErrorIdentifier as raw provider codes before cheaper-inference#12506 added the bounded vocabulary; without them huggingchat-stream-error-boundary and zai-web-silent-empty-repro see 'bad_gateway' instead of the pinned codes. - imageGeneration.saveImageErrorResult: String(error) throws 'Cannot convert object to primitive value' on the null-prototype objects sanitizeUpstreamDetails returns — use JSON.stringify. Fixes 3 codex image-generation tests. - streamFailureBoundary: new keepReadable option; emitTranslatedFailureAndAbort (parsed.error mid-stream path) uses it so the forwarded response.failed frame is not discarded when the readable errors — restores the kiro response.failed contract from cheaper-inference#12454/cheaper-inference#12455 that 2265ce7 broke. - chat.ts image-model rejection hint: 'Use POST /v1/images/generations instead.' → 'Then POST …' — 'Use' is not a prose boundary, so the fail-closed span swallowed the endpoint and the cheaper-inference#6457 assertion never matched. - sync-models route: parseError messages gain a 'GET' route-context marker ('Invalid JSON response from GET /models') so the path redactor's route shield preserves the endpoint (test updated to the new strings). - tunnel-routes canary: updated for the sanitizer's intentional growth — quoted-path and windows-shape leaks are now covered by the shared sanitizer; the canary pins the new coverage map per its own instructions.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…2455) Validado em lote numa worktree combinada com os 14 PRs desta campanha de error-boundary sobre o tip de `release/v3.8.51`: `typecheck:core` limpo e **120/120** nos 23 arquivos de teste que os PRs trazem. Um ponto que só apareceu no tree combinado: **cheaper-inference#12465 e cheaper-inference#12466 criam o mesmo arquivo novo** `open-sse/utils/streamReadiness.ts` (que não existe no tip) com desenhos divergentes de cancelamento — `cancelled` + `releaseLock` imediato num, `readInFlight`/`cancelRequested` com `cancelReader` fire-and-forget no outro. Adotei a versão do cheaper-inference#12466, que difere e defere o release do lock para quando a leitura em voo termina, e validei a escolha rodando as suítes dos **dois** PRs contra ela: 21/21 no readiness compartilhado e 22/22 incluindo o boundary do Perplexity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
status.failedframes received before model output into a canonical, sanitized502 readiness failure, and terminate immediately even when the upstream socket stays open.
output before raising a fixed public 502 stream error through the existing Chat finalization path.
finish_reason: "stop"; partial failures nowend with the strict Chat
finish_reason: "error"frame and invoke failure/persistence callbacksexactly once.
cancel()hook that stallsforever.
This fix is standalone and does not depend on a separate shared public-error projector change.
Security, wire, and isolation contract
message/error/codefields are selected, bounded to 512 characters, and routed throughbuildErrorBody()Zed upstream stream failedreaches the client and completion callback[DONE]are emitted; neitherresponse.failednor a normal stop is emittedNODE_ENV=test, syntheticAPI_KEY_SECRET, and test flags; no provider credential/token,HOME, orCODEX_HOMEis inheritedDATA_DIRand plugin directory before imports, blocks ambientfetch, resets DB, closes the shared logger, restores state, and removes temp directoriesValidation
Exact candidate head:
bc565e8633bcb252809fa5421f92d0ada968eb89response.failedframing and lost content before the final implementation--test-isolation=none: the unrelated call-log drain assertion deterministically failed because the old Zed test changed top-levelDATA_DIR/DB state--test-isolation=none, with no concurrency overrideopenSseTypecheckErrors=0git diff --checkpassedsecretFindings=0; the child receives no inherited provider credentialse243b04de22da2d78900c27fde5f83f4fbc3d7f9without conflicts; focused 52/52 tests and gates rerun on candidatebc565e8633bcb252809fa5421f92d0ada968eb89Reconciliation
7802f6ea163f18f349348dbfd8710a159ac32e15in an isolated worktree.
e243b04de22da2d78900c27fde5f83f4fbc3d7f9; there was no overlap in the ownedZed production/test/changelog fragment paths.
open-sse/executors/zed-hosted.tsSHA-256017686e4f41106be1cecf373dc1e939d9686c24fce93f0937758eaabde9cd4b0.