Skip to content

bug(hooks): genie-hook native client emits wrong [from:] attribution — orchestrator name leaks (#1485 followup) #1491

@namastex888

Description

@namastex888

Summary

Followup to #1485. The compiled genie-hook thin client is supposed to honor GENIE_AGENT_NAME from its environment when forwarding the hook to the daemon, so the eventual SendMessage (and other identity-bearing hooks) shows [from:<actual-agent>]. Instead, every dispatched hook is attributed to [from:genie] (the orchestrator), regardless of the env the client was invoked with.

Repro (per dog-fooder-11eb verdict, 2026-04-29)

cd /home/genie/workspace/repos/genie/.worktrees/dogfood-session
bun run build && bun link
genie serve start --daemon --headless
bun build --compile src/hooks/dispatch-client.ts --outfile dist/genie-hook
printf '%s' '{"hook_event_name":"PreToolUse","tool_name":"SendMessage","tool_input":{"recipient":"genie","message":"identity probe"},"session_id":"dogfood-env-probe"}' \
  | GENIE_AGENT_NAME=dogfood-env-probe GENIE_TEAM=genie dist/genie-hook

# Expected: [from:dogfood-env-probe]
# Actual:   [from:genie]

Evidence: /home/genie/workspace/agents/genie/.genie/agents/dog-fooder/state/evidence/batch-2034c4f3

Why this is a release-blocker

Every SendMessage from a daemon-mode hook would attribute the message to whichever agent owns the daemon process (typically genie), not the actual sender. That breaks identity-based routing, scope-validation, and audit trails. End-users would see all messages appearing to come from one source.

Acceptance

  • Compiled genie-hook reads GENIE_AGENT_NAME from process.env and forwards it through the UDS frame
  • Daemon-side dispatcher honors the forwarded name when stamping [from:] on outgoing identity-bearing hooks
  • Repro above produces [from:dogfood-env-probe] end-to-end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions