Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

copilotkit project select rewrites INTELLIGENCE_API_KEY to CPK_INTELLIGENCE_API_KEY, which OpenDots never reads

Đã đóng Phù hợp với người mới
#55 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@charan-rathore đang làm issue này rồi.

Từ ngày 4/10/2026.

  • #72 của @charan-rathore — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend, documentation

Hướng nghiên cứu

Bắt đầu với việc xử lý các khóa môi trường trong src/server/index.ts, sau đó xem xét các kiểm tra liên quan trong src/server/platform-config.ts và src/server/platform.ts. Tái hiện quy trình được ghi lại trong docs/SETUP.md bằng .env.example và xác nhận rằng khóa được CLI ghi vào được nhận diện, cảnh báo thiết lập biến mất, và các hướng dẫn thiết lập giải thích các tên được hỗ trợ cũng như thứ tự ưu tiên của chúng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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_KEY
  • src/server/platform-config.ts:32 — !config.intelligenceKey && 'INTELLIGENCE_API_KEY' in setupStatus() (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

  1. npm ci && cp .env.example .env
  2. npx --yes copilotkit@latest login && npx --yes copilotkit@latest project select
  3. grep INTELLIGENCE .env → shows CPK_INTELLIGENCE_API_KEY=cpk-…; the INTELLIGENCE_API_KEY= line is gone
  4. npm run dev → "Connect your Dot" banner persists and Settings & setup lists INTELLIGENCE_API_KEY as missing
  5. 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.

Ngôn ngữ chính
TypeScript
Star
2.8k
Fork
344
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CopilotKit/OpenDots

Tất cả issue của CopilotKit/OpenDots

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.