Skip to content

fix(runtime-host): preserve provider failure diagnostics - #2675

Merged
M4n5ter merged 3 commits into
mainfrom
fix/provider-error-diagnostics
Aug 11, 2026
Merged

fix(runtime-host): preserve provider failure diagnostics#2675
M4n5ter merged 3 commits into
mainfrom
fix/provider-error-diagnostics

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 11, 2026

Copy link
Copy Markdown
Member
English

Summary

  • Preserve an allowlisted, redacted, and bounded provider failure summary at the ModelAdapter boundary
  • Project the canonical terminal RuntimeEvent failure message through Runtime Host Turn snapshots
  • Attach the exact existing execution trace when Desktop copies an error report
  • Reuse canonical Turn projection and existing execution inspection instead of adding a diagnostics authority

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 only failureClass, 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

  • Runtime build and typecheck; full suite: 3,315 passed, 9 skipped
  • Runtime Host build and typecheck; full suite: 866 passed
  • UI and Desktop build/typecheck; 33 targeted Desktop tests passed
  • Biome and git diff --check
中文

概要

  • 在 ModelAdapter 边界保留经过白名单筛选、脱敏和长度限制的 provider 错误摘要
  • 通过 Runtime Host Turn snapshot 投影 canonical terminal RuntimeEvent 中的失败消息
  • Desktop 复制错误报告时附加现有 execution trace 中的精确执行证据
  • 复用 canonical Turn projection 和现有 execution inspection,不新增诊断 authority

根因

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 相应递增。

验证

  • Runtime build、typecheck;完整测试 3,315 项通过、9 项跳过
  • Runtime Host build、typecheck;完整测试 866 项通过
  • UI 与 Desktop build/typecheck;33 项相关 Desktop 测试通过
  • Biome 与 git diff --check

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
M4n5ter force-pushed the fix/provider-error-diagnostics branch from 5f622f4 to a276fd7 Compare August 11, 2026 06:08
@M4n5ter
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.
@M4n5ter M4n5ter changed the title Preserve provider failure diagnostics fix(runtime-host): preserve provider failure diagnostics Aug 11, 2026
@M4n5ter
M4n5ter merged commit 944b295 into main Aug 11, 2026
10 checks passed
@M4n5ter
M4n5ter deleted the fix/provider-error-diagnostics branch August 11, 2026 06:49
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.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant