Skip to content

fix(db): ensure container_configs row when creating an agent group#2539

Open
abarbaccia wants to merge 1 commit into
nanocoai:mainfrom
abarbaccia:fix/agent-groups-ensure-container-config
Open

fix(db): ensure container_configs row when creating an agent group#2539
abarbaccia wants to merge 1 commit into
nanocoai:mainfrom
abarbaccia:fix/agent-groups-ensure-container-config

Conversation

@abarbaccia
Copy link
Copy Markdown

Summary

  • createAgentGroup only inserted into agent_groups, leaving spawnContainer to throw Container config not found for agent group: <id> forever for any agent created via ncl groups create.
  • Call the existing idempotent ensureContainerConfig(group.id) inline so a fresh group is immediately spawnable with sensible defaults.
  • Added a unit test asserting a default container_configs row exists after createAgentGroup.

How I hit this

Created a new agent group via ./bin/ncl groups create --name "Homey - Shopping" --folder shopping, wired a WhatsApp group, sent a message. Host logged wakeContainer failed on every sweep with Container config not found for agent group: 6aaeafe8-…. Backfilling the row by calling ensureContainerConfig directly resolved it; this PR makes that happen on creation.

Test plan

  • pnpm exec vitest run src/db/db-v2.test.ts — 33/33 pass, including new "should create a default container_configs row"
  • pnpm run build — clean tsc
  • Manual: created a fresh group via ncl groups create, confirmed ncl groups config get --id <new> returns a row immediately (no No container config for group: error)

🤖 Generated with Claude Code

createAgentGroup only inserted into agent_groups, leaving spawnContainer
to throw "Container config not found" forever for any agent created via
ncl groups create. ensureContainerConfig is idempotent and already used
elsewhere — call it inline so a fresh group is immediately spawnable.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.

1 participant