Repository navigation
Create Learning containers with the runtime key alone - #1031
Draft
guidovizoso wants to merge 5 commits into
Draft
guidovizoso wants to merge 5 commits into
guidovizoso wants to merge 5 commits into
Conversation
Intelligence 0.16.0 lets a project key create a Learning container in its own project (POST /api/v1/learning/containers, idempotent by id). The server now creates the openbot default and each person's own space with the key it already holds, and nothing else. Gone: the CopilotKit CLI login path and its project matching, the service token (INTELLIGENCE_SERVICE_TOKEN with INTELLIGENCE_PROJECT_ID), and the check that a created container was not in another project, which a key cannot do. The existence probe reads the container itself instead of inferring it from the skills read's error codes, and the key no longer has to work out its own project from a dashboard link. On an older Intelligence the log and Admin say to upgrade, or to create a container with ID openbot by hand.
The Job existed to create the openbot container with a CLI login or a service token, because the server could not. Now it can, so the Job, the config.learning.setup values, their validation and the CI render of the Job go. Old values are ignored, so an upgrade with them set still renders.
…nning it With a key, the helper creates the container with that key, with no CLI and no browser. Fresh managed setup creates it with the key it just provisioned. Fresh self-hosted setup still signs in, since that is what mints the key. start.sh no longer runs the helper on every start: the server does it.
This branch has not been deployed
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 this changes
Intelligence 0.16.0 lets a project's runtime key create a Learning container in its own project (
POST /api/v1/learning/containers, idempotent by id). Until now OpenBot could not do that with the key it holds, so it tried a CLI login, a service token or a browser sign-in. This PR makes the server create theopenbotdefault and each person's own Learning space with the runtime key, and removes the rest.Removed
INTELLIGENCE_SERVICE_TOKENwithINTELLIGENCE_PROJECT_ID, in config, the server and the chart.config.learning.setup.cliLoginSecret/serviceTokenSecret/projectId, their validation, and the CI step that rendered the Job.scripts/start.shran on every start (the server now does it at boot).Simplified
GET /api/v1/learning/containers/:id) instead of inferring it from the skills read's error codes. The key no longer works out its own project from a dashboard link.scripts/setup-learning.ts: with a key, it creates the container with that key. Fresh managed setup creates it with the key it just provisioned. Fresh self-hosted setup still signs in through the browser, because that is what mints the key, and the desktop app uses that path.server/src/learning/ensure-container.tsgoes from 800 lines to about 300, of which about 100 are the CLI helpers the other setup scripts still share.On an Intelligence older than 0.16.0, the log and Admin → Automatic Learning say to upgrade, or to create a container with ID
openbotby hand.Do not merge until production Intelligence runs 0.16.0. Hosted OpenBot talks to managed Intelligence, which is on 0.15.1 today, and has no route that lets a key create a container. The bundled chart and the desktop app already ship 0.16.0-rc.7.
Overlap with #987: both PRs change the Learning-credentials block in
server/src/index.tsand the service-token config inserver/src/config.ts. Whichever merges second resolves a small conflict there. This PR changesserver/src/learning/personal-space.tsonly enough to drop the removed check, because #987 rewrites that file.Where it runs
openbotor a person's space at once. Intelligence answers 200 (or 409LEARNING_CONTAINER_ALREADY_EXISTS) to all but the first, and those count as present. The assignment is still the existing conditional insert, so one replica wins.Boundary and audit
learning-auto-assign/create_failed, as before.Changelog
CHANGELOG.mdunderUnreleased.Proof
openbotreturns present; a new container is absent, then created; creating it again returns present; probing it then returns present. A fresh OpenBot on that stack created and assignedopenbotby itself at start (learning-auto-assign→assigned).bun testoverserver/tests/learning*,server/tests/config.test.ts,scripts/setup-learning.test.ts,scripts/self-hosted-learning.test.ts,scripts/start-restart-guard.test.ts,scripts/setup-composio.test.tsandapp/tests/learning-admin.test.tsx: all pass.server/tests/learning-mastra.test.ts,server/tests/learning-langgraph.test.tsandtests/chart-bundled-intelligence.test.ts, 480 pass, 0 fail.bun run lint,format:check,typecheck,typecheck:tests(one baseline entry this change fixed is dropped) andbuildpass.helm templateplusscripts/check-rendered-chart.tspass on all six CI targets. Rendering with the oldconfig.learning.setup.*values set still succeeds; they are ignored.