CedarCopilot wants to merge 1 commit into staging from fix/agent-files-team-sections
Libra exercised 2 changed behaviors; none regressed.
Libra ran this behavior against the change and confirmed the check detects when it breaks.
Changed code: AgentOutputTab.tsx.
Libra ran this behavior against the change and confirmed the check detects when it breaks.
Changed code: team-sections.ts.
Live on prod, watching, 2 days left
Libra has verdicts on 0 of 1 tracked behaviors on prod; 1 is still being checked. Libra checks hourly for 3 days after each deploy.
scope.type === 'org', but the agent page mounts at the user scope (AgentView passes no scope, so it defaults to user, and fileScope is just that). Sahand (Aspire) and Arie saw only their own user/agent-{id} files, with no rep folders.showsTeamSections: on for anything except a deal folder, off when a person is named (targetUserId) or a view-as perspective is active. The server still decides who gets a non-empty list (agent.getTeamMembers, org admin or agent manager), so a rep still sees nothing extra.showsTeamSections cases in team-sections.test.ts (user scope on, undefined scope on, deal folder / named person / view-as off); 8 pass.apps/mail typecheck shows no errors in the touched files (the remaining ./+types/* errors are pre-existing generated-route types).listAgentTeamMembers returns 5 reps for Sahand, 6 for Arie and ak, 3 for Peter, and none for a rep.cedar-prod):
['cedar-prod'] | where _time > ago(1h) and message == "[agent] getTeamMembers"
| project _time, caller_user_id, agent_id, via, member_count, truncated
member_count equal to the reps who own rows. Expanding a rep's section then issues the confined listing, which logs [files] manager teammate-scope read only for a non-admin manager.via: none is not logged by design; a rep opening the tab should produce no extra section.Customer: Aspire, Pirros
🤖 Generated with Claude Code
The PR appears safe to merge, though a tab-level regression test would better protect the fix.
### Issue 1
apps/mail/modules/agents/__tests__/team-sections.test.ts:87-90
The new tests check the scope helper, but not whether `AgentOutputTab` requests team members and renders their sections at the user-scope mount. The previous regression was in that connection, so these tests would still pass if rep folders disappeared from the Files tab again. A component test covering that path would protect the fix.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
The PR enables teammate file sections at the agent page’s user-scope mount, while keeping them off in deal and named-person views.
Libra has not measured any production surfaces for this change yet.