Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d18bf8d26
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function isMissingEndpointFallback(error: unknown): boolean { | ||
| // Distinguish an older server without `GET /bots/:id/channels` (generic 404) | ||
| // from a deleted/unknown bot (`bot.not_found`). | ||
| return apiErrorStatus(error) === 404 && !isApiErrorCode(error, 'bot.not_found') |
There was a problem hiding this comment.
Preserve HTTP status for legacy channel lookups
When Desktop connects to an older server returning HTTP 404 as {"message":"Not Found"}, the generated SDK throws only the parsed body (packages/sdk/src/client/client.gen.ts:189–211). Consequently, apiErrorStatus(error) is undefined, the legacy fallback never runs, and both Overview and Platforms fail despite the per-platform endpoints still working. Message-only 404s from the legacy per-platform probes have the same problem. Preserve the actual response.status in these compatibility lookups and test real HTTP response shapes rather than mocked errors that already contain status. Desktop directly reuses this Web implementation, so this affects the separately distributed client.
AGENTS.md reference: apps/web/AGENTS.md:L3-L3
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Author
Type
Summary
internal/handlers/users.go注册GET /bots/{id}/channels(ListBotChannelConfigs),复用channelStore.ListConfigs与authorizeBotAccess(要求manage权限),返回非空切片items(ListBotChannelsResponse),并同步更新 OpenAPI 文档与@memohai/sdk(getBotsByIdChannels);后端保留既有GET /bots/{id}/channel/{platform}(GetBotChannelConfig)以兼容尚未升级的捆绑版客户端。useBotChannels为单次批量并发查询(Promise.all([getChannels, getBotsByIdChannels])),移除前端对旧服务端逐平台探测的回退逻辑;真实错误(403/5xx/断网与bot.not_found等)直接抛出,不再被误吞后渲染为空白“未配置”。canManageBotPermissions;修复bot-overview.vue渠道错误未解包error.value的问题,并在bot-channels.vue与bot-overview.vue展示加载失败态与重试入口,无manage权限时跳过查询与平台空态。apps/web/src/lib/api-client.ts的setupApiClient中幂等安装attachErrorResponseStatus错误拦截器(client.interceptors.error),确保@hey-api/client-fetch在throwOnError: true抛出非 Problem Details JSON(如{ message: "..." })或纯文本响应体时,异常对象仍携带status: response.status,网络异常(TypeError等)原样透传;补充基于真实Response对象的单测。/ping能力加载至普通 Pinia Store:useCapabilitiesStore收敛为带单飞去重(inflight)与会话代次隔离(sessionGeneration)的普通 Pinia store,不再依赖localStorage持久化查询缓存或访问内部_pc_query注册表,并修复登出与在途/ping响应交错导致的会话串号与重复请求问题。files-pane.vue(isTransientWorkspaceError)与bot-settings.vue(isNameConflict)中依赖未本地化服务端英文文案的子串匹配死分支,统一改用稳定错误码isApiErrorCode及409状态码判断,并同步更新.agents/skills/memoh-error-handling/SKILL.md的状态码保留说明。Related Issues
Validation
go test ./internal/handlers/... ./internal/channel/... ./internal/apperror/... ./internal/server/...与golangci-lint run --new-from-rev=32e2ce05b ./internal/handlers/...通过(含TestListBotChannelConfigs5 项子测试)。node scripts/check-ui-contract.mjs、node scripts/check-settings-rows.mjs、node scripts/check-patched-deps.mjs通过。pnpm --filter @memohai/web typecheck、pnpm --filter @memohai/desktop typecheck、pnpm exec eslint apps/web/src apps/desktop/src(0 errors)通过。pnpm vitest run(304个测试文件全部通过,2789passed /1skipped,含api-client.test.ts14/14、useBotChannels.test.ts、capabilities.test.ts)与VITE_API_URL=/api pnpm --filter @memohai/web build通过。cmd/agent serve(127.0.0.1:18192)与vite preview(127.0.0.1:18184),通过ego-browser验证:/settings/bots/neko仅发出 1 次GET /api/ping(200)与GET /api/bots/.../channels(200),GET /api/bots/.../channel/{platform}请求次数为0,无运行期 JS 异常。/settings/bots/neko?tab=channels)仅使用批量接口,无运行期 JS 异常。/settings/about)发出0次额外GET /api/ping,无运行期 JS 异常。Screenshots / Recordings
Human QA