fix(db): ensure container_configs row when creating an agent group#2539
Open
abarbaccia wants to merge 1 commit into
Open
fix(db): ensure container_configs row when creating an agent group#2539abarbaccia wants to merge 1 commit into
abarbaccia wants to merge 1 commit into
Conversation
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]>
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.
Summary
createAgentGrouponly inserted intoagent_groups, leavingspawnContainerto throwContainer config not found for agent group: <id>forever for any agent created viancl groups create.ensureContainerConfig(group.id)inline so a fresh group is immediately spawnable with sensible defaults.container_configsrow exists aftercreateAgentGroup.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 loggedwakeContainer failedon every sweep withContainer config not found for agent group: 6aaeafe8-…. Backfilling the row by callingensureContainerConfigdirectly 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 tscncl groups create, confirmedncl groups config get --id <new>returns a row immediately (noNo container config for group:error)🤖 Generated with Claude Code