Description
genie dir add <name> --dir <path> --global appears to succeed but doesn't persist the agent entry to the PG agents table. Subsequent directory.resolve() calls fail with "Agent not found in genie directory".
Reproduction
genie dir add felipe-scout --dir /home/genie/workspace/agents/felipe/agents/felipe-scout --global
# Output: "Agent registered (global)"
genie dir ls felipe-scout --json
# Output: "Agent not found in directory or built-ins"
Root Cause
The agent directory is now PG-backed (agent-directory.ts). The add() function inserts into the agents table with id = 'dir:<name>'. However, when --global is passed, the _options?: ScopeOptions parameter with { global: true } is accepted but never used — the function always does the same PG insert regardless of scope.
The issue may be that:
- The PG connection fails silently during add (no error thrown)
- The
--global flag triggers a different code path that doesn't persist
- The insert succeeds but the query in
resolve() doesn't find it
Impact
- Omni bridge cannot resolve agents registered with
--global
- Non-owner WhatsApp messages fail to route to their assigned agent
- Agent spawn fails with
"Agent not found in genie directory"
Workaround
Register without --global:
genie dir add felipe-scout --dir /home/genie/workspace/agents/felipe/agents/felipe-scout
🤖 Generated with Claude Code
Description
genie dir add <name> --dir <path> --globalappears to succeed but doesn't persist the agent entry to the PGagentstable. Subsequentdirectory.resolve()calls fail with "Agent not found in genie directory".Reproduction
Root Cause
The agent directory is now PG-backed (
agent-directory.ts). Theadd()function inserts into theagentstable withid = 'dir:<name>'. However, when--globalis passed, the_options?: ScopeOptionsparameter with{ global: true }is accepted but never used — the function always does the same PG insert regardless of scope.The issue may be that:
--globalflag triggers a different code path that doesn't persistresolve()doesn't find itImpact
--global"Agent not found in genie directory"Workaround
Register without
--global:🤖 Generated with Claude Code