Add validateRecipient() to check that mail recipients correspond to existing agents before sending. This prevents mail from being stored with invalid assignees that won't match inbox queries. The validation queries agent beads and checks if any match the recipient identity. The only special case is "overseer" which is the human operator and doesn't have an agent bead. Tests create a temporary isolated beads database with test agents to validate both success and failure cases. Tests are skipped if bd CLI is not available (e.g., in CI). Fixes gt-0y8qa Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
23 KiB
23 KiB