Skip to content

discovery(llc): dual agent-identifier keyspace — AgentOrgNode.id (UUID PK) vs agent_id (String slug) used inconsistently across joins #10032

Description

@mrveiss

Discovered during

#9861 review (org-chart assigned-count enrichment) — the enrichment initially joined str(LLCWorkItem.assignee_agent_id) (UUID) against AgentOrgNode.agent_id (String(255) logical slug) and silently returned 0 for hire-generated slug agents.

The two keyspaces

  • AgentOrgNode.id — UUID PK. Used by work_items._item_to_dict (work_items.py:255) to resolve assignee_agent_id.
  • AgentOrgNode.agent_id — String(255) logical id (hire flow generates e.g. assistant-...-{hex8}, agent_hires.py:252). Used by llc_agent_budgets.agent_id (feat(llc/budget): no public endpoint to provision a per-agent budget #9901), heartbeat scheduler dispatch, controls pause/resume.

Any join/lookup that picks the wrong column compiles fine and returns empty/zero rows — invisible in SQLite tests that seed agent_id = str(uuid4()) (both keyspaces collide to the same string).

Suggested resolution

Document the convention (which column is the FK target for which table) in the LLC models module; add a lint/test helper that seeds NON-UUID slugs in harnesses so wrong-column joins fail loudly; audit existing joins (budget, org-chart, work-item assignee, runs) for consistency.

Related: #9861, #9901, #8997, umbrella #9923.

Activity

  1. github-actions commented on Jun 21, 2026

    @github-actions
    Contributor

    PR #10399 (merged to Dev_new_gui) references this issue with a close keyword.

    fix(llc): resolve dual agent-id keyspace wrong-column joins (#10032)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions