Skip to content

fix(channel): 关联账号引导补全,/link 轮询不再闪烁 - #1372

Merged
qqqqqf-q merged 3 commits into
felinics:mainfrom
qqqqqf-q:fix/linked-accounts-guidance
Sep 24, 2026
Merged

qqqqqf-q merged 3 commits into
felinics:mainfrom
qqqqqf-q:fix/linked-accounts-guidance

Conversation

@qqqqqf-q

@qqqqqf-q qqqqqf-q commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Author

  • Human
  • Agent

Type

  • bug
  • feat
  • test

Summary

外部用户反馈在 IM 里被 Bot 拒绝(「仅机器人所有者…」「没有执行该 Bot 工作区命令的权限」),根因是 所有者的 IM 账号没关联 Memoh 账号;Web 端「个人资料 → 关联账号」已有 /link 流程,但拒绝提示里没有任何指引,用户不知道去哪儿关联。同时关联页在等待 /link 时每 3 秒整块闪成 spinner、关联码消失。

改动:

  1. 关联页不再闪烁(connected-accounts-section.vue):Pinia Colada 的 isLoading 在每次后台 refetch 都为 true,3s 轮询 refetchBindings 时整块被替换成 spinner。改用 isPending(只在首次加载为 true),列表和关联码在轮询/KeepAlive 重新激活时保持在屏。关联成功后额外 toast.success(用户此时通常在看 IM)。卡片内容用 AutoHeight 包住,关联码块出现/收起时卡片平滑增高,与 provider 设备码面板一致。
  2. IM 拒绝提示给出关联路径:
    • cmd.error.ownerOnly:写命令被拒时追加「在 Memoh 网页端「个人资料 → 关联账号」获取关联码,再发送 /link <关联码>」。
    • 外部 Agent(Claude Code / Codex / ACP)运行时下,reason=account_user_unbound 改用新 key chat.externalAgent.accountUnbound,说明是账号未关联并给出同样的指引;missing_workspace_exec / runtime_owner_mismatch 等其他 reason 文案不变。
    • cmd.error.accessDeniedHint 统一术语(连接码→关联码、拥有者→所有者;en connection code→link code;ja 接続コード→リンクコード)。
  3. 关联页副标题、关联码说明文案重写,说明关联的作用;新增 settings.connectedAccounts.linked。三语(zh/en/ja)同步,Web 侧也补了 chat.externalAgent.accountUnbound 以保持两边 key 一致。

已确认:关联后所有者会经 channelaccess.inheritedManage 获得写命令权限,外部 Agent 的 workspace_exec 检查也会以关联的 user 通过,所以指引的动作确实能解决问题。

对 Cloud 的影响:只改文案与一处前端状态,不涉及接口/配置;handler.go 与 Cloud 一致,channel.go / 关联页 / locale 在 Cloud 的差异不与本改动重叠,预计 sync 无冲突。

Related Issues

无(来自外部用户反馈)。

依赖 felinics/ui#30(AutoHeight 在 KeepAlive 切回时不再从 0 重新增高)。等它合并后,本 PR 再 bump packages/ui gitlink;在此之前本 PR 暂不合并。

Validation

  • go test ./internal/channel/inbound/... ./internal/command/... ./internal/i18n/... ./internal/handlers/... 通过;pre-commit hook 的 golangci-lint + go test 通过。
    • 新增 TestRequireWorkspaceExecUnboundIdentityPointsToLink:未关联身份走外部 Agent 门禁时回复包含 /link 与关联路径。
    • TestExecute_WritePermissionDenied 追加 /link 断言。
  • Web:改动文件 eslint 通过。本地 vue-tsc 因 packages/ui 的 #/lib/utils 解析失败报大量无关错误(改动文件 0 个),以本 PR 的 CI typecheck 为准。
  • Agent 浏览器自检(本地 OSS dev 栈,en 界面):点击 Get Link Code 后 9.5s 内发生 4 次 channel-identities 轮询,按 50ms 采样 186 次,关联码始终在屏、无 spinner。
  • Agent 浏览器自检:点击 Get Link Code 后卡片 height 过渡 141px → 232px,约 230ms(transitionrun/transitionend 事件与 16ms 采样确认)。
  • 未验证:关联成功 toast(需要真实 IM 发送 /link)、zh/ja 视觉、修复前闪烁的实机复现(依据 Pinia Colada 源码中 isLoading = asyncStatus === 'loading' 推断)。

Screenshots / Recordings

未上传截图:本地截图无法通过 CLI 作为 GitHub 附件上传。视觉变化仅为文案与「轮询时不再出现 spinner」,替代验证见 Validation 中的浏览器采样;人工 QA 时补充截图。

Human QA

  • Human QA passed(清凤本地确认:关联账号卡片无闪动、高度动画正常、关联码复制正常)

- 关联账号页只在首次加载显示 spinner,后台 3s 轮询保留关联码;关联成功弹提示
- ownerOnly 与外部 Agent 的 account_user_unbound 回复指向「个人资料 → 关联账号」+ /link
- 统一关联码/所有者术语(zh/en/ja)
@qqqqqf-q
qqqqqf-q requested review from a team September 24, 2026 09:21
@github-actions github-actions Bot added bug Fixes a bug or unexpected behavior change:server Changes backend code, configuration, or API contracts change:web Changes web frontend or shared frontend packages size:S PR size uses the larger of added or deleted lines, excluding generated files labels Sep 24, 2026
与 provider 设备码面板一致,用 AutoHeight 包住卡片内容。
@github-actions github-actions Bot added the needs:format Description needs template corrections; removed automatically once fixed label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@qqqqqf-q Please complete the following information using the template:

  • Keep exactly one "Human QA passed" checkbox in "Human QA"; leave it unchecked until verified.

Editing the description triggers another check; format feedback does not block or cancel code CI.

@qqqqqf-q
qqqqqf-q merged commit 0385fcc into felinics:main Sep 24, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes a bug or unexpected behavior change:server Changes backend code, configuration, or API contracts change:web Changes web frontend or shared frontend packages needs:format Description needs template corrections; removed automatically once fixed size:S PR size uses the larger of added or deleted lines, excluding generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant