fix(runtime-host): preserve provider failure diagnostics - #2675
Merged
Conversation
Provider failures can arrive as structured values that generic error handling reduced to an unhelpful fallback. Retain only bounded and redacted provider fields, project a concise failure through Runtime Host, and reuse the existing execution trace when Desktop copies an error report.\n\nAdvance the Runtime Host compatibility epoch because failed Turn snapshots gain an optional field.
Unify provider error facts so JSON-shaped failures cannot escape the diagnostic allowlist. Derive failed Turn messages from the terminal runtime ledger, reserve their worst-case snapshot size before queue admission, and preserve raw infrastructure errors for trace diagnostics.
M4n5ter
force-pushed
the
fix/provider-error-diagnostics
branch
from
August 11, 2026 06:08
5f622f4 to
a276fd7
Compare
M4n5ter
marked this pull request as ready for review
August 11, 2026 06:14
Carry the sanitized provider failure into the canonical terminal RuntimeEvent so live projection and recovery share the same message fact. Read Desktop diagnostic evidence by exact Turn admission, keeping reports available when the surrounding Session exceeds inspection limits.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 11, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 11, 2026
Preserve the original apache#2521 implementation history while accepting apache#2675 and current main as the canonical Runtime Host diagnostic path. The follow-up commit reapplies only the remaining classification and presentation changes.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 11, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
6 tasks
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 11, 2026
apache#2675 now owns provider diagnostic transport, so use that path and carry forward only the remaining classification work.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 11, 2026
A 403 is not enough to conclude that credentials are invalid. Prefer structured provider evidence and let ambiguous Kimi permission_error failures keep the bounded explanation added by apache#2675.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 12, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 13, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 17, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 17, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 18, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 19, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings.
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 19, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings. Generated-by: Maka
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 19, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings. Generated-by: Maka
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 20, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings. Generated-by: Maka
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 20, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings. Generated-by: Maka
me2seeks
added a commit
to me2seeks/maka-agent
that referenced
this pull request
Aug 20, 2026
Keep ambiguous 403 responses out of authentication classification, preserve the bounded provider explanation added by apache#2675, and use structured provider identifiers for stable account-state meanings. Generated-by: Maka
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.
English
Summary
Root cause
AI SDK provider failures may arrive as plain structured values rather than Error instances. Generic error normalization reduced unknown structured failures to
Operation failed, and the Runtime Host Turn projection retained onlyfailureClass, so Desktop diagnostics could not reconstruct the provider reason.Safety and correctness
JSON-shaped strings are parsed before allowlisted fields are selected; request bodies, prompts, arbitrary headers, and credentials are not copied into diagnostics. Session admission reserves the largest valid failed Turn snapshot, and the terminal RuntimeEvent remains the single failure-message fact across crash recovery.
Previously opaque structured provider failures now retain a safe provider message and available metadata. Historical provider details that were already discarded remain unrecoverable.
The Runtime Host compatibility epoch advances because failed Turn snapshots gain an optional bounded
failureMessage.Validation
git diff --check中文
概要
根因
AI SDK 的 provider 错误可能是普通结构化值,而不是 Error 实例。通用错误归一化会将未知结构化错误压缩为
Operation failed,Runtime Host Turn 投影又只保留failureClass,因此 Desktop 诊断无法还原 provider 原因。安全性与正确性
JSON 形式的字符串会先解析,再选择白名单字段;请求体、prompt、任意 headers 和凭据不会被复制到诊断中。Session admission 会预留合法 failed Turn snapshot 的最大空间,terminal RuntimeEvent 在崩溃恢复前后始终是失败消息的唯一事实来源。
此前不透明的结构化 provider 错误现在会保留安全的 provider 消息和可用元数据。此前已经丢失的历史 provider 详情无法恢复。
由于 failed Turn snapshot 新增了可选且有界的
failureMessage,Runtime Host compatibility epoch 相应递增。验证
git diff --check