Repository navigation
Get the Composio key from the CopilotKit sign-in again - #1042
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 6, 2026 03:17
davidmckayv
force-pushed
the
david/composio-key-at-sign-in
branch
from
November 6, 2026 03:33
1b4ea66 to
6d9de5e
Compare
The 0.3.0 desktop never asked CopilotKit for this installation's Composio project, so every install started with COMPOSIO_API_KEY empty and apps unavailable. #971 asked during the app's own CopilotKit sign-in; #832 replaced that sign-in with the bundled CLI's and left provisioning out, because the Ops route returned 404 in production at the time. The route is live now. The CLI now does it, as the Ops contract names it: `copilotkit integrations composio provision --installation-id <id> --env-path <file> --json`, with the session its own login saved. OpenBot never reads that session. The CLI writes the key into an owner-only handoff folder in the installation, which OpenBot reads, moves to the protected store as COMPOSIO_PROVISIONED_API_KEY and removes. The key is never written to .env. - The Account step connects apps once the person is signed in. A failure shows the existing sentence with Connect apps to retry and Continue to go on without apps. - Every Start of an installation with local Intelligence and no key tries again, so an install signed in under 0.3.0 gets its key on its next Start without signing in again. A failure never stops Start. - A key the person supplied in .env or the environment, or an Arcade choice, still wins and is never asked about or moved. Ops replays the same key for an installation, so a retry never makes a second project. - The direct Ops request and its HTTP test helper are gone; the CLI is the only client.
davidmckayv
force-pushed
the
david/composio-key-at-sign-in
branch
from
November 6, 2026 03:46
6d9de5e to
482735d
Compare
1 task done
davidmckayv
added a commit
that referenced
this pull request
Nov 6, 2026
* Write the 0.3.1 changelog from the code Rebuilt from each change since v0.3.0 (#1037, #995, #996, #1041, #1040, #1039, #1042, #1043) and the open #1044, every line checked against its diff. The terminal entry #1037 added under 0.3.0 moves to Unreleased, since v0.3.0 does not contain it. * Match the 0.3.1 changelog to #1044's final head An operator's model is the default while the credential lists it, nothing writes one on their behalf, one person picks from every listed model, a team picks among the models an admin allows, and a pick applies from the next message. Checked against 90d2201.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
OpenBot Desktop 0.3.0 never got a Composio key from the CopilotKit sign-in. Every desktop install started with
COMPOSIO_API_KEYempty, so apps were unavailable. This gets the key again, through the CLI the app already signs in with, and gives installs signed in under 0.3.0 a key on their next Start without signing in again.Root cause
COMPOSIO_PROVISIONED_API_KEY, andcomposio::resolvepassed it to the server at Start.login, and removedconnect_apps, its IPC tests and the call toprovision.resolvestayed, so Start would still have used a saved key, but nothing saved one.Was it deliberate
Yes, for a reason that no longer holds. #832's description and
docs/desktop-install.mdsay provisioning was left out because the Ops route it calls returned 404 in production. The route is live now: an unauthenticatedPOST /api/cli/integrations/composio/projectgets 401 (the CLI session middleware), and a made-up route next to it gets 404. No credential was sent.#832's design still holds. The CLI owns the CopilotKit account, and
local_eval.rsnever reads the CLI's credential files. So OpenBot doesn't call Ops itself. The CLI does, using the command Intelligence's Ops contract names for this (docs/contracts/openbot-composio-provisioning.md):copilotkit integrations composio provision --installation-id <UUID> --env-path <file> --json. The bundled CLI (256cc68) has it.What changed
local_eval.rs): one more fixed command,integrations composio provision. Its arguments are a validated lowercase installation id and an absolute file path OpenBot made. The CLI's one line of metadata is believed only when it reportscompletedfor the installation asked about, with the file written. Stderr is never read.composio.rs): the CLI writes the key into~/OpenBot/.openbot-apps/composio.env, an owner-only folder. OpenBot reads the key, checks the report, saves it to the protected store and removes the folder, whatever the CLI did. A folder an interrupted attempt left behind is cleared before the next one. The key is never written to.env. The direct Ops request and its HTTP test helper are removed, so the CLI is the only client.CopilotKitAccount.tsx,connect_copilotkit_apps): once the person is signed in and has agreed, it connects apps and shows "Connecting your apps…". On a failure it shows the existing "OpenBot couldn't connect your apps…" sentence, with Connect apps to retry and Continue to go on without apps.persist_start_environment): an installation with local Intelligence and no key tries again before the broker keys are resolved. That covers installs signed in under 0.3.0. A failure is logged and never stops Start..envor the environment always wins and is never moved, and so does an Arcade choice. Neither causes a request. Ops replays the same key for an installation (reused: true), so retries never make a second project.docs/desktop-install.mdanddocs/plugins/composio.mdnow describe this flow.Tests
composio_ipc_tests.rs,a_copilotkit_sign_in_gives_start_a_composio_key):integrations.ts: it reads its own session, posts{"installationId"}with that bearer to a fake Ops on 127.0.0.1, and writes the key into the file it was given.installationId, projectId, apiKey, reusedas the contract describes..env, no handoff folder is left behind, and the next Start asks nobody.left: None,right: Some("synthetic-project-key")) and passes here.local_eval.rs. The handoff (failures, mismatched reports, leftover folders, replay) and the retry round trip incomposio.rs.COPILOTKIT_CONFIG_DIR.cargo fmt --checkandcargo clippy --all-targets -- -D warnings: clean.cargo test: 814 + 195 + 7 pass.tsc --noEmit: clean.bun test desktop/src: 261 pass.bun run format:checkandbun run lint: clean.