Repository navigation
fix(adapta): redact streamed upstream errors - #12438
Merged
diegosouzapw merged 5 commits intoSep 3, 2026
Merged
Conversation
…3851-adapta-stream-error-boundary
…3851-adapta-stream-error-boundary
…3851-adapta-stream-error-boundary
diegosouzapw
marked this pull request as ready for review
September 3, 2026 23:56
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
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
type: "error"diagnostics into the public HTTP-200 SSE body;finish_reason: "stop"and[DONE];DATA_DIR, plugin-directory, DB, call-log-writer,fetch, and event-bus mutations;401boundary stub.Candidate
ee3f2cf691ca406ddf2d6c3482d15f4c428e559b0d0aaaf0aa03e74499c8809b8bc274beffc2db63e545d256db394e26ca8a5b5f8b3a4350af31149197041954171ee3aa3f51a7fb01748797c23716f8e243b04de22da2d78900c27fde5f83f4fbc3d7f9The latest release refresh was a normal merge, without conflict, rebase, or force-push. No release commit since the previously reconciled tip touched any of the four PR-owned Adapta paths.
Public error boundary
\n\n[Erro: Adapta upstream error]is emitted for the hostile error eventfinish_reason: "stop"anddata: [DONE]are presentfetchcalls are intercepted; no live upstream call or credential is usedTest-isolation repair: RED → GREEN
2/3under--test-isolation=nonepaired withcall-log-save-drainDATA_DIRmutation redirected the call-log artifact; its existence assertion failed (false !== true)1/11/13/3call-log-save-drainand the Adapta wrapper pass together without concurrency or singleton poisoning6/6--test-isolation=noneIsolation and secret hygiene
process.env/globalThisPATH,NODE_PATH,LANG,LC_ALL,TZ,TMPDIR, test flags, syntheticAPI_KEY_SECRET, isolatedDATA_DIR, and isolated plugin directory...process.env, provider tokens,HOME, orCODEX_HOME;NODE_TEST_CONTEXTis explicitly removed before spawnfetchoverride exist only in the subprocess;fetchis restored after the testfinally; no parent singleton is opened or closedByte-for-byte preservation
The isolation follow-up changes tests only. These pre-existing PR files remained byte-identical before and after the release merge:
open-sse/executors/adapta-web.tsac4ab65e51c4cc25cbec800dd5096605af680678b84924bf15678887a70d1b44tests/unit/executor-adapta-web.test.tsbc1a0845ad3bdb292e7d56f87117b126ae1ade97f515af9cca1a0a84199ef179Isolation harness hashes:
tests/unit/executor-adapta-web-stream-error.test.ts37d652c94e18267f71127866543d14a4378b194cad062ba202222af23d776e66tests/fixtures/adapta-web-stream-error-boundary.fixture.ts3771f1cce8566550393c5a9d0ab7269a98db062b9dd0eab9afe4309beb7da3baLatest release-base reconciliation
e243b04de22da2d78900c27fde5f83f4fbc3d7f9ee3f2cf691ca406ddf2d6c3482d15f4c428e559bFinal gates on the exact head
00openSseTypecheckErrors=0git diff --check0130349906…Risk and rollback
The production delta remains the original narrow one-branch redaction: attacker-controlled
event.errorTextis no longer copied into a public HTTP-200 stream. Normaltext-delta,done, and non-streaming paths are unchanged. The follow-up delta is test-only and moves stateful setup across a process boundary. Reverting the isolation commit restores only the former test harness; reverting the original security commit restores the former public-error behavior.This PR intentionally remains a draft. Do not merge, enable auto-merge, deploy, or release from it until exact-head CI is reviewed.