Repository navigation
Read the CLI-written CPK_INTELLIGENCE_API_KEY as the Intelligence key fallback - #802
charan-rathore wants to merge 3 commits into
Conversation
… fallback The CopilotKit CLI saves the runtime key as CPK_INTELLIGENCE_API_KEY, while the server only read INTELLIGENCE_API_KEY. A deployment that ran the CLI without setup-learning.ts refused to boot with a missing INTELLIGENCE_API_KEY error until the key was copied by hand. Fall back to CPK_INTELLIGENCE_API_KEY when INTELLIGENCE_API_KEY is unset, keeping the unprefixed variable authoritative when both are present. Closes CopilotKit#800 Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
Codex Review SummaryThis 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: 841f1d21ce
ℹ️ 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".
| optional(environment, "INTELLIGENCE_API_KEY") ?? | ||
| optional(environment, "CPK_INTELLIGENCE_API_KEY"), |
There was a problem hiding this comment.
Synchronize the CLI-key setup guidance
When users follow the checked-in setup guidance, .env.example:134 still says that the server cannot see CPK_INTELLIGENCE_API_KEY, while prompt.txt:106-108 still requires copying that value to INTELLIGENCE_API_KEY before startup. This fallback makes both instructions false, so the documented CLI/local-connect workflow continues to require the manual step that this change is intended to remove; update those guidance surfaces alongside the new alias.
Useful? React with 👍 / 👎.
…lback Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0341f6e0bc
ℹ️ 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".
| // copies it across, but a deployment that ran only the CLI would otherwise refuse to boot. | ||
| apiKey: | ||
| optional(environment, "INTELLIGENCE_API_KEY") ?? | ||
| optional(environment, "CPK_INTELLIGENCE_API_KEY"), |
There was a problem hiding this comment.
Update the remaining local-connect README guidance
When users follow the README's local Intelligence flow, README.md:140-146 still says OpenBot reads the key only from INTELLIGENCE_API_KEY and requires copying the CLI value before scripts/start.sh. The fallback on this line makes that statement false, so the primary setup page still teaches the manual copy this change removes; update that section along with the other guidance.
Useful? React with 👍 / 👎.
Signed-off-by: Charan Rathore <180254320+charan-rathore@users.noreply.github.com>
|
Codex Review: Didn't find any major issues. Hooray! 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". |
Closes #800.
The CopilotKit CLI saves the runtime key as
CPK_INTELLIGENCE_API_KEY, while the server only readINTELLIGENCE_API_KEY. A deployment that ran the CLI withoutsetup-learning.tsrefused to boot with a missingINTELLIGENCE_API_KEYerror until the key was copied by hand.This falls back to
CPK_INTELLIGENCE_API_KEYwhenINTELLIGENCE_API_KEYis unset. The unprefixed variable stays authoritative when both are present, and the existing forwarding (INTELLIGENCE_API_KEY: settings.apiKey) is unchanged.Tests: two new cases in
server/tests/config.test.tscover the fallback and the precedence.bun test server/tests/config.test.ts scripts/setup-learning.test.ts scripts/start-restart-guard.test.tspasses 177/177, andbunx biome lint --error-on-warningsis clean on both files.