Skip to content

bug: genie dir add --global silently fails to register agent in PG #1107

@namastex888

Description

@namastex888

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:

  1. The PG connection fails silently during add (no error thrown)
  2. The --global flag triggers a different code path that doesn't persist
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions