Skip to content

Start the one-container image without a Bot it does not contain - #107

Merged
davidmckayv merged 7 commits into
CopilotKit:mainfrom
jeonjw85:fix/managed-agent-optional
Aug 21, 2026
Merged

Start the one-container image without a Bot it does not contain#107
davidmckayv merged 7 commits into
CopilotKit:mainfrom
jeonjw85:fix/managed-agent-optional

Conversation

@jeonjw85

Copy link
Copy Markdown
Contributor

What this changes

The one-container image does not carry agent-bot or agent-langgraph. MANAGED_AGENT_AG_UI_URL was required and defaulted to localhost:4201, so the shipped Risk Analyst coworker was registered against a host that was not there and every conversation with it failed. The image looked deployed.

The URL is no longer required. Unset, the server starts, the package omits that coworker, and creating one without its own endpoint is refused rather than pointed at nothing. A leftover MANAGED_AGENT_TOKEN from scripts/start.sh is ignored. A URL with no token still refuses to start.

scripts/start.sh still points a laptop at agent-langgraph. The URL stays in the script rather than .env, so docker run --env-file .env does not inherit it.

A .env copied from an older .env.example still has MANAGED_AGENT_AG_UI_URL=http://localhost:4201/ag-ui. Unset it before running the image.

The deployment doc no longer says to run one replica because the snapshot cache is in process memory. That moved to Postgres in #90.

Where it runs

  • New state that outlives a request? None. Boot configuration and a package load.
  • What happens on the second replica? Each process reads the same environment and the same package. A replica with the URL set and one without would disagree about whether Risk Analyst exists; that is an environment split, not a cache.
  • Anything serialised? No. Package sync still upserts what the package currently names and does not delete a leftover Risk Analyst row from an earlier boot that had the URL set.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Every acting call still goes through the gateway: unchanged.
  • New refusals and new failures each write a row: creating a coworker with no endpoint and no managed Bot is refused at the store with ManagedAgentUnavailableError, mapped to 400. No new audit class; nothing was acted on.
  • Nothing new is trusted from the client that the server can resolve itself.

Changelog

  • UnreleasedUpgrading and Fixed. The one-replica warning under Deployment is also gone.

Proof

  • bun test server/tests/config.test.ts server/tests/tenant-package.test.ts server/tests/agent-profile-store.integration.test.ts server/tests/runtime-agents.integration.test.ts: 86 pass, 0 fail.
  • bun run --filter server typecheck and bun run --filter app typecheck: clean.
  • bun x biome format / lint clean on the changed TypeScript. Pre-existing noTemplateCurlyInString warnings in tenant-package.test.ts are unchanged.

Test plan

  • docker run with no MANAGED_AGENT_AG_UI_URL. Expect the image to answer, and Risk Analyst not on the roster.
  • Same with a leftover MANAGED_AGENT_TOKEN and no URL. Expect the same.
  • bash scripts/start.sh on a laptop. Expect Risk Analyst present and talking to agent-langgraph.
  • Create a coworker with no endpoint on the image. Expect a refusal, not a silent dead Bot.

MANAGED_AGENT_AG_UI_URL is no longer required. A URL with no token still
refuses to start; a leftover token with no URL is ignored, so a
one-container image can boot from a laptop .env.
The shipped Risk Analyst points at MANAGED_AGENT_AG_UI_URL. When that is
unset the endpoint is empty, the coworker is left out of the roster, and
channels drop the reference rather than failing to load.
…naged Bot

Product-created coworkers used to fall back to the managed URL. Without
one that fallback is gone, so create and duplicate say so instead of
storing an agent that cannot answer.
scripts/start.sh still points at agent-langgraph for a local stack. The
URL stays in the script rather than .env, so docker run --env-file .env
does not inherit a host the image does not contain.
The image does not carry agent-langgraph. Requiring a URL against
127.0.0.1:4201 was the same lie the healthcheck used to tell.
The snapshot cache already lives in Postgres, so the one-replica warning
is also gone.
@jeonjw85
jeonjw85 force-pushed the fix/managed-agent-optional branch from 9f49dac to 03c443d Compare August 21, 2026 20:37
@davidmckayv
davidmckayv merged commit dbb4a7f into CopilotKit:main Aug 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants