copilotkit project select rewrites INTELLIGENCE_API_KEY to CPK_INTELLIGENCE_API_KEY, which OpenDots never reads
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend, documentation
调研方向
先从 src/server/index.ts 中的环境键处理开始,然后检查 src/server/platform-config.ts 和 src/server/platform.ts 中的相关检查。使用 .env.example 重现 docs/SETUP.md 中记录的流程,并确认 CLI 写入的键能够被识别、设置警告会消失,以及设置说明解释了受支持的名称和优先级。
由索引模型根据 Issue 内容生成。
描述
Summary
npx copilotkit@latest project select deletes the INTELLIGENCE_API_KEY line from .env and writes CPK_INTELLIGENCE_API_KEY instead. OpenDots reads only the unprefixed name and has no fallback, so the "Connect your Dot" banner stays and chat remains disabled even after a successful CLI login — with no error anywhere pointing at the name mismatch.
Verified against OpenDots c2569bb (2026-10-02) and [email protected].
OpenDots reads only INTELLIGENCE_API_KEY
src/server/index.ts:29—intelligenceKey: process.env.INTELLIGENCE_API_KEYsrc/server/platform-config.ts:32—!config.intelligenceKey && 'INTELLIGENCE_API_KEY'insetupStatus()(this is the list the Settings & setup sidebar renders)src/server/platform.ts:154—{ error: 'Setup required: INTELLIGENCE_API_KEY.' }
grep -rn "CPK_" src/ returns nothing, so the prefixed variable is invisible to the app. .env.example also seeds only the unprefixed name (INTELLIGENCE_API_KEY=).
The CLI prunes that line and writes a different name
[email protected], writeHostedApiKey() in the bundled index.js (around line 124155):
const standardizedContent = removeEnvAssignmentLine(
existingContent,
"INTELLIGENCE_API_KEY"
);
withFsErrorTag(
() => fs21.writeFileSync(
envPath,
upsertEnvAssignments(standardizedContent, [
["CPK_INTELLIGENCE_API_KEY", apiKey]
])
)
);
So the CLI removes the exact line .env.example provides and replaces it with a name OpenDots never reads. CPK_INTELLIGENCE_API_KEY is treated as canonical throughout the CLI (PROJECT_KEY_VARIABLE = "CPK_INTELLIGENCE_API_KEY", line 434080).
Why this is more than a docs gap
docs/SETUP.md:81 instructs users to run this in the Slack setup flow:
npx --yes copilotkit@latest project select
npx --yes copilotkit@latest channels add --name opendots --display-name "OpenDots" --adapter slack --json
Anyone who follows that documented command silently breaks an Intelligence credential that was already working. The failure mode is also misleading: the app reports the key as missing, so the natural conclusion is "the CLI didn't write my key" rather than "it wrote it under a different name and deleted the old line."
Repro
npm ci && cp .env.example .envnpx --yes copilotkit@latest login && npx --yes copilotkit@latest project selectgrep INTELLIGENCE .env→ showsCPK_INTELLIGENCE_API_KEY=cpk-…; theINTELLIGENCE_API_KEY=line is gonenpm run dev→ "Connect your Dot" banner persists and Settings & setup listsINTELLIGENCE_API_KEYas missing- Adding
INTELLIGENCE_API_KEY=cpk-…(same value) clears the banner and enables chat
Suggested fix
Accept both names, preferring the one the CLI writes:
intelligenceKey:
process.env.CPK_INTELLIGENCE_API_KEY ?? process.env.INTELLIGENCE_API_KEY,
and mention the precedence in docs/SETUP.md. A docs-only note would leave the documented Slack flow still self-defeating, so I'd lean toward the fallback in code.
One accuracy note: the CLI help describes COPILOTKIT_API_KEY as the deprecated name (line 442947), not INTELLIGENCE_API_KEY. So this isn't a case of OpenDots using an officially deprecated variable — it's an unprefixed/prefixed mismatch between a template and the CLI that edits that template's .env.
- 主要语言
- TypeScript
- 星标
- 5.5k
- 派生
- 796
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 53
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CopilotKit/OpenDots 的其他 Issue
-
Page conversation panel overflows horizontally可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
CopilotKit/OpenDots#69 ·
维护者通常 2 天内回复
-
Long page titles are clipped in the page editor可能已有人在做 @charan-rathore 于 14 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
CopilotKit/OpenDots#68 ·
维护者通常 2 天内回复
-
Add a way to delete specialist Dots可能已有人在做 @XENONCYBER 于 3 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
CopilotKit/OpenDots#151 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 8/100
CopilotKit/OpenDots#149 ·
维护者通常 2 天内回复
-
Adopt Knip with staged cleanup and blocking CI checks可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 25/100
CopilotKit/OpenDots#147 · 1 条评论 ·
维护者通常 2 天内回复
查看 CopilotKit/OpenDots 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Koenkk/zigbee-herdsman-converters#13540 ·
维护者通常 1 天内回复
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area/busola/ux
难度 2/5 1-3 小时 新手友好度 68/100
kyma-project/busola#5442 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
vercel-labs/wterm#246 ·
维护者通常 1 天内回复