Repository navigation
fix: diagnose adapter delivery failures safely - #77
Merged
Merged
Conversation
OBenner
commented
Nov 16, 2026
OBenner
left a comment
Owner
Author
There was a problem hiding this comment.
Ревью dev — принять.
Проверено по diff (4 файла, +110/−1):
- Скоуп соблюдён: только runner diagnostics из #39.
reportFailureна обоих путях (authorize/submit), tracking/retry-семантика не изменена — после диагностики тот жеtracker.set({kind: "failure", code: "RETRYABLE", clientIdempotency: true}). - Redaction корректен по слоям: (а) explicit secrets из construction — сортировка по длине desc перед заменой (короткий секрет не «разобьёт» длинный); (б) Bearer/Basic-паттерн; (в) credential-поля (token/password/secret/api_key/authorization/cookie, с кавычками и без); (г) control chars → space (одна строка гарантирована); (д) cap 2000. Тест пинит все слои, включая отсутствие текста сообщения в выводе.
- Fail-safe sink: try/catch вокруг записи + тест «stderr closed» — диагностика не может сломать delivery reporting. Это ровно защита от класса инцидента, который лечим.
- Формат: через существующий
formatDiagnostic(#24) — ISO 8601, консистентно с остальными логами. - Wiring честный: relay token и OpenCode auth передаются из production construction (
adapter.ts,stdio.ts),authToken ?? ""+.filter(Boolean)закрывает undefined/пустую строку.
Неблокирующий нит (не к этому PR): позиционные undefined, undefined в вызовах конструктора стали заметнее — если появится ещё один параметр, стоит перейти на options-объект. Не требую правки.
CI 3/3 зелёный. Финальное ревью — за CTO.
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.
HttpAdapterRunner silently converted authorize/submit exceptions into tracked delivery failures, hiding the cause of stalled delivery. Both paths now emit ISO 8601 stderr diagnostics with the stage, error code and message before preserving the existing retry handling.
Runner construction supplies the relay credential and OpenCode service credential for exact redaction. Diagnostics also redact common credential fields and Bearer/Basic values, flatten control characters and cap message length. An injected stderr sink supports MCP diagnostics and tests; a failing sink cannot interrupt delivery failure reporting.
Validation: pnpm verify passed (86 files, 773 tests, formatting, imports, typechecking and build). Tests cover both failure paths, credential redaction, single-line output and a throwing diagnostic sink.
Scope: only the runner diagnostics follow-up in #39. Election tests and history pagination are excluded. Arbitrary unlabeled secrets unknown to the caller cannot be identified reliably from free-form error text.