CopilotKit / CopilotKit/OpenTag

支持为 Agent 配置飞书用户身份授权,而不仅限于 bot 身份

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
125
Avg merge
7d 1h
Merged PRs (30d)
1

Description

使用场景
希望 OpenTag Agent 能通过本机 lark-cli,以已授权用户的身份访问飞书资源、管理任务和执行群相关操作。
目前本机 CLI 已完成用户登录,但 OpenTag 会话使用独立注入的 bot 凭证,无法继承本机用户身份。
当前情况
环境:OpenTag 0.0.5,macOS,Codex runtime。

  • 本机执行 lark-cli auth status --json --verify,用户身份验证通过。
  • Agent 会话反馈:--as user 被拒绝;凭证由外部托管,无法执行 auth 或 config 管理操作。
  • 本地发布代码中的 #feishuEnvironment 为会话指定独立配置目录、注入 tenant_access_token,并将 LARKSUITE_CLI_USER_ACCESS_TOKEN 设为 undefined。
    因此,本机 CLI 登录成功不代表 OpenTag Agent 可以使用用户身份。重新登录本机 CLI 无法解决该问题。
    功能需求
    希望增加官方支持的飞书用户身份接入:
  1. 在 Agent 的飞书连接设置中,提供用户授权入口,明确区分 bot 和 user 身份。
  2. 用户主动授权后,将凭证限定到指定账号、连接和 Agent,避免自动继承本机全部权限。
  3. 安全保存凭证,支持 Token 自动续期、解绑和撤销。
  4. 为已授权会话注入用户凭证,允许使用 --as user,同时保留 bot 能力。
  5. 授权变更后刷新会话凭证;若需要新建会话,在界面中明确提示。
  6. 诊断页面显示实际身份及阻碍原因,区分未授权、Token 失效、缺少 scope、应用可用范围不足等情况。
    验收标准
  • 授权后,Agent 能验证并使用正确的飞书用户身份。
  • 能以 user 身份执行授权范围内的只读操作。
  • 未授权的 Agent 无法使用该用户凭证。
  • Token 续期无需通过独立终端手动登录。
  • 解绑或撤销后停止使用用户凭证。
  • 凭证不出现在提示词、普通日志或聊天输出中。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the #feishuEnvironment handling and the existing Feishu connection and credential injection paths. Trace how bot credentials reach Agent sessions, then define the authorization, token lifecycle, session refresh, identity diagnostics, and revocation behavior required by the acceptance criteria; the work is done when scoped user access works without exposing credentials.

Written by the indexing model from the issue text.

Assessment

Tech stack
cli, typescript
Domain
authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.