fix(agent-registry): canonicalize known assignee-agent aliases (claude -> claude-code) - #266
Merged
Merged
Conversation
…aude-code) Handoff/inbox assignee matching compares assignee_agent by exact string against the caller's own detected identity (which resolves to claude-code, never claude). A human typing 'handoff to claude' silently stored the literal string, so it never matched the claude-code inbox filter. item::create/item::update now canonicalize known aliases before writing assignee_agent, so both handoff and plain item-update paths are covered from one place.
…registry agent-registry already documents itself as the one source of truth for agent identifiers (init --agent, hook --agent, the agents subcommand); the alias table added to agentflare-backend in the previous commit was exactly the per-feature duplication that doc comment warns against. Moved canonicalize() there and had agentflare-backend call it, so any future consumer of agent names gets the same alias resolution instead of growing its own copy.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesThe registry adds Claude alias canonicalization with pass-through behavior for unknown values. Backend item creation and updates apply the helper before persisting Assignee canonicalization
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ItemAPI
participant canonicalize
participant Database
ItemAPI->>canonicalize: normalize assignee_agent
canonicalize-->>ItemAPI: return canonical value
ItemAPI->>Database: persist canonical assignee_agent
Database-->>ItemAPI: return item
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handoff/itemassignee matching comparedassignee_agentby exact string against the caller's own detected identity, which always resolves toclaude-code— typinghandoff to claudesilently stored the literalclaudeand the item never showed up in the claude-code inbox filter.agent_registry::canonicalize()as the single alias table ("claude","claude code","claude-code-cli"->"claude-code", extensible, unknown input passes through unchanged) — placed inagent-registrysince it already documents itself as agentflare's one source of truth for agent identifiers, instead of growing a duplicate table inagentflare-backend.agentflare-backend::item::create/updatenow canonicalizeassignee_agentthrough it, covering both thehandofftool path and the plainitem(action=update, assignee_agent=...)path from one place.Test plan
cargo test -p agentflare-agent-registry -p agentflare-backend(105 passed, incl. newcanonicalize_maps_known_aliases_and_passes_through_unknownandcreate_and_update_canonicalize_known_assignee_aliases)cargo clippy -p agentflare-agent-registry -p agentflare-backend --all-features -- -D warningscleancargo build --workspacegreenSummary by CodeRabbit
claude,claude code, andclaude-code-cli.