Repository navigation
群聊插话页读取失败不再拼接 Host 原文,按原因显示(ambient-read-error-raw) - #224
Merged
lc-cn merged 2 commits intoNov 28, 2026
Merged
Conversation
- describeReadFailure:无权限改按 statusFromError 判断(Host 的 forbidden 码、401/403),与 StatusState 一致;摘要不再带 Host 原文,原文只留在 detail - 状态与设置两部分把错误直接交给 StatusState error=,不再传自拼的 description,标题与说明按原因(需要新版 Host / 无权限 / 读取失败),原文在技术详情 - 状态部分有旧数据时刷新失败改为紧凑的 StatusState,说明下面是上次读到的数据 - 群列表选择器(不在本项范围)仍在 ErrorAlert 里写明原因 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLUGBDtJbRzDTQgkyE1mGh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLUGBDtJbRzDTQgkyE1mGh
Deploying zhin-demo-console with
|
| Latest commit: |
51c6165
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3c319c32.console-axj.pages.dev |
| Branch Preview URL: | https://console-ambient-read-error-r.console-axj.pages.dev |
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.
关联 #64:
ambient-read-error-raw问题
群聊插话页(/features/ai/ambient)的「状态」和「设置」两部分读取失败时,把 Host 原文直接拼进说明,例如「群聊插话状态读取失败:Unknown RPC type: plugin.root.ambient」。这带来三个问题:
StatusState按原因给出的标题和说明:接口不存在本应显示「需要新版 Host」,结果一律是「读取失败」;{ code: 'forbidden' }时没有走无权限分支,仍显示「Forbidden」。确认问题存在的依据:
ambient-engagement-model.mjs:382-386的describeReadFailure返回「{0}读取失败:{1}」,ambient-engagement.tsx:155和:301把它作为description传给StatusState;isPermissionDenied的固定文字和 HTTP 401/403 文本,不认 Host 的forbidden码;改法
isReadDenied(error)(新):无权限的判断是以下任一项:isPermissionDenied);statusFromError(error).kind === 'forbidden',即 Host 的forbidden码或 401/403。状态读取、设置读取和设置里的群列表选择器都改用它,三处判断一致。
describeReadFailure:摘要不再带 Host 原文(非无权限时为「{0}读取失败,请稍后重试。」),原文只放在detail里。两部分的错误状态:直接交给
StatusState error=,不再传自拼的description,标题和说明按原因显示(需要新版 Host / 无权限 / 读取失败),原文只在「技术详情」里。状态部分有旧数据时刷新失败:原来是一行红字加原文,改为紧凑的
StatusState,说明「刷新失败,下面是上次读到的数据。」,原因在技术详情里。群列表选择器:它用的是
ErrorAlert,没有技术详情,所以仍由它自己写明「群列表读取失败:原因」。这句沿用原有的「{0}读取失败:{1}」文案和英文条目,只是改在选择器里拼。没有新增文案。
验证
npx tsc --noEmit、pnpm test(1974 通过)、pnpm lint:css、pnpm build全部通过(首屏 JS 507.5KB gzip)。新测试
tests/ambient-read-error-raw.test.mjs(修复前失败)覆盖:detail;forbidden码、「Forbidden」文字、403 拒绝和旧 Host 文字都判为无权限,Unknown RPC type不算;StatusState且不传自拼说明;forbidden码同样判为无权限。原有的
ambient-group-picker两个测试按新行为更新:状态部分不再有自拼说明,摘要不再带原文;群列表选择器仍显示原因。Playwright:预览 Host 打开 /features/ai/ambient,拦截
/api/console/request中的plugin.root.ambient和config:get-source。浅色 / 深色、375 / 1280 都看过,均无横向滚动。TypeError: …Unknown RPC type{ code: 'forbidden' }ambient:read)独立审查(只读子 Agent,只看条目原文和 diff):没有阻塞问题,并确认
status-state-model.mjs不引入循环依赖。它提出的点:isReadDenied,并补了测试。StatusState按原因给的说明,例如「建议 N 秒后重试」。这里保留:这一行要说明的是「下面是上次读到的数据」,标题仍按原因显示,原因在技术详情里。describeReadFailure的非无权限摘要现在只在群列表没有原文时用到:保留,作为兜底。本次没有改动样式(没有新增或修改 CSS 规则,只复用
StatusState和已有 class),遵守样式冻结(#125)。#111:
Generated by Claude Code