fix: MCP init tool creates .beads in current directory
Critical bug: MCP init tool reported success but didn't create .beads directory. It was using --db flag which tells bd to use an existing database elsewhere instead of creating a new one. Root cause: - bd_client.init() was calling _global_flags() which adds --db flag - bd init --db <path> uses existing db instead of creating new one - Result: init appeared to succeed but created nothing Fix: - Remove _global_flags() from init command - Only pass --actor flag (safe for init) - Do NOT pass --db flag to init (defeats the purpose) - Add explicit comment explaining why Testing: - Added test_init_creates_beads_directory() integration test - Verifies .beads directory is created in current working directory - Verifies database file has correct prefix - All 91 tests pass This was causing silent failures where agents thought they initialized bd but the .beads directory was never created. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -462,7 +462,11 @@ class BdClient:
|
||||
if params.prefix:
|
||||
cmd.extend(["--prefix", params.prefix])
|
||||
|
||||
cmd.extend(self._global_flags())
|
||||
# NOTE: Do NOT add --db flag for init!
|
||||
# init creates a NEW database in the current directory.
|
||||
# Only add actor-related flags.
|
||||
if self.actor:
|
||||
cmd.extend(["--actor", self.actor])
|
||||
|
||||
try:
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
|
||||
Reference in New Issue
Block a user