Skip to content

fix(agent-registry): canonicalize known assignee-agent aliases (claude -> claude-code) - #266

Merged
getappz merged 3 commits into
masterfrom
fix/canonicalize-assignee-agent-alias
Jul 19, 2026
Merged

fix(agent-registry): canonicalize known assignee-agent aliases (claude -> claude-code)#266
getappz merged 3 commits into
masterfrom
fix/canonicalize-assignee-agent-alias

Conversation

@getappz

@getappz getappz commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • handoff/item assignee matching compared assignee_agent by exact string against the caller's own detected identity, which always resolves to claude-code — typing handoff to claude silently stored the literal claude and the item never showed up in the claude-code inbox filter.
  • Added agent_registry::canonicalize() as the single alias table ("claude", "claude code", "claude-code-cli" -> "claude-code", extensible, unknown input passes through unchanged) — placed in agent-registry since it already documents itself as agentflare's one source of truth for agent identifiers, instead of growing a duplicate table in agentflare-backend.
  • agentflare-backend::item::create/update now canonicalize assignee_agent through it, covering both the handoff tool path and the plain item(action=update, assignee_agent=...) path from one place.

Test plan

  • cargo test -p agentflare-agent-registry -p agentflare-backend (105 passed, incl. new canonicalize_maps_known_aliases_and_passes_through_unknown and create_and_update_canonicalize_known_assignee_aliases)
  • cargo clippy -p agentflare-agent-registry -p agentflare-backend --all-features -- -D warnings clean
  • cargo build --workspace green

Summary by CodeRabbit

  • New Features
    • Added consistent canonical naming for Claude agent aliases, including claude, claude code, and claude-code-cli.
  • Bug Fixes
    • Assignee agent names are now normalized consistently when creating or updating items, improving behavior with alternate Claude agent names.
    • Unknown agent names continue to be preserved as entered.
  • Tests
    • Added unit coverage for alias canonicalization during both create and update.

getappz added 2 commits July 19, 2026 21:53
…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.
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e268689-b50a-48ac-9824-5169fa10d840

📥 Commits

Reviewing files that changed from the base of the PR and between 448297b and 4a55054.

📒 Files selected for processing (1)
  • crates/agentflare-backend/src/item.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/agentflare-backend/src/item.rs

📝 Walkthrough

Walkthrough

Changes

The registry adds Claude alias canonicalization with pass-through behavior for unknown values. Backend item creation and updates apply the helper before persisting assignee_agent, with tests covering registry mapping and item persistence.

Assignee canonicalization

Layer / File(s) Summary
Canonicalization contract
crates/agent-registry/src/registry.rs, crates/agent-registry/src/lib.rs
Adds the public canonicalize helper, tests known aliases and unknown-value pass-through, and reformats the existing re-export.
Item persistence integration
crates/agentflare-backend/Cargo.toml, crates/agentflare-backend/src/item.rs
Adds the registry dependency and canonicalizes assignee values during item creation and updates, with coverage for both paths.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: canonicalizing known assignee-agent aliases in the agent registry and backend.
Description check ✅ Passed The description covers summary and test plan well, but it omits the Notes for reviewers section and the cargo fmt check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/canonicalize-assignee-agent-alias

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit c7ec692 into master Jul 19, 2026
18 checks passed
@getappz
getappz deleted the fix/canonicalize-assignee-agent-alias branch July 19, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant