Skip to content

fix(site/src/pages/AgentsPage): make other-user chats read-only - #25736

Merged
ibetitsmike merged 2 commits into
mainfrom
mike/fix-agents-chat-owner-banner
May 27, 2026
Merged

ibetitsmike merged 2 commits into
mainfrom
mike/fix-agents-chat-owner-banner

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

Other-user agent chats showed a banner that implied prompts would run as the owner, but submitting from that view is forbidden.

This updates the banner to identify the chat owner and makes chats owned by another user read-only in the UI by disabling the composer and hiding inline send or edit follow-up actions.

Mux working on behalf of Mike.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review

coder-agents-review Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-05-27 15:07 UTC by @ibetitsmike
Spend: $41.50 / $100.00

Review history
  • R1 (2026-05-27): 8 reviewers, 4 Nit, 5 P3, COMMENT. Review
  • R2 (2026-05-27), 4 Nit, 5 P3, COMMENT. Review
  • R3 (2026-05-27): 6 reviewers, 4 Nit, 5 P3, APPROVE. Review
  • R4 (2026-05-27): 3 reviewers, 4 Nit, 5 P3, COMMENT. Review

deep-review v0.5.0 | Round 4 | 0c27224..2f8c695

Last posted: Round 4, 9 findings (5 P3, 4 Nit), COMMENT. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Author fixed (2f8c695) AgentChatPage.stories.tsx:1244 AdminViewingOtherUserChat and SharedReadOnlyChat are duplicate stories R1 Bisky P3, Nami Nit, Gon Nit Yes
CRF-2 P3 Author fixed (2f8c695) AgentChatPageView.tsx:429 No test for "another user" fallback label R1 Bisky Yes
CRF-3 P3 Author fixed (2f8c695) AgentChatPageView.tsx:538 Inline action hiding untested (all other-user stories use empty messages) R1 Bisky Yes
CRF-4 P3 Author fixed (2f8c695) AgentChatPageView.tsx:430 isOtherUserChat name encodes UI decision, not ownership fact R1 Gon Yes
CRF-5 P3 Author fixed (2f8c695) AgentChatPageView.tsx:432 Banner states ownership but not the read-only consequence R1 Leorio Yes
CRF-6 Nit Author fixed (2f8c695) AgentChatPage.stories.tsx:1244 Story names reflect removed authorization model R1 Bisky, Gon Yes
CRF-7 Nit Author fixed (2f8c695) AgentChatPageView.tsx:434 effectiveIsInputDisabled always equals isInputDisabled today R1 Pariston Nit, Nami Note Yes
CRF-8 Nit Author contested; panel closed R3 (6/6 accept) AgentChatPage.stories.tsx:1244 AdminViewingOtherUserChat drops canShareChat authorization mock R1 Mafuuu Yes
CRF-9 Nit Author fixed (2f8c695) AgentChatPageView.tsx:54 ChatOwnerInfo has no doc comment explaining both-fields-absent case R1 Leorio Yes
CRF-10 Nit Dropped by orchestrator (clause provides scenario context, not redundancy) AgentChatPageView.stories.tsx:276 Story comment "stay read-only" clause R1 Gon No
CRF-11 Note Dropped by orchestrator (pre-existing; backend intentionally RBAC-only for interrupt; 3 reviewers confirm correct) AgentChatPageView.tsx:562 Interrupt button not suppressed for non-owners R1 Mafuuu P3 No
CRF-12 Note Dropped by orchestrator (pre-existing, input disabled via isArchived) AgentChatPageView.tsx:430 Archived other-user chats skip inline action gates R1 Nami No

Contested and acknowledged

CRF-8 (Nit, AgentChatPage.stories.tsx:1244) - Missing canShareChat authorization mock

  • Finding: Reviewer said OtherUserChatReadOnly (renamed from AdminViewingOtherUserChat) lacks a canShareChat authorization mock, causing MSW to log a warning for the unhandled request.
  • Author defense: OtherUserChatReadOnly uses buildQueries(...), and buildQueries already appends buildChatAuthorizationQuery(chat, { canShareChat: { action: "share", allowed: chat.owner_id === MockUserOwner.id && !chat.parent_chat_id } }). For this other-user root chat, that creates the canShareChat: false mock. No extra mock is needed.
  • Panel closure (R3, 6/6): All six reviewers (Bisky, Mafuuu, Pariston, Nami, Hisoka, Leorio) independently traced buildQueries and confirmed the mock is present. owner_id: "other-user-id" differs from MockUserOwner.id, producing canShareChat: false. The old explicit buildChatAuthorizationQuery override was redundant with what buildQueries already provided.

Round log

Round 1

Panel (Bisky, Hisoka, Mafuuu, Mafu-san, Pariston, Nami, Gon, Leorio). Netero clean. 5 P3, 4 Nit, 2 Note new. 3 dropped. Reviewed against 0c27224..bbd75ff97.

Round 2

BLOCKED. CRF-8 silent. 8 of 9 posted findings addressed. No review.

Round 3

Panel (Bisky, Mafuuu, Pariston, Nami, Hisoka, Leorio). Netero clean. CRF-8 contested; panel closed (6/6). All prior fixes verified. 0 new findings. Reviewed against 0c27224..2f8c695.

Round 4

Panel (Bisky, Mafuuu, Pariston). Head SHA unchanged from R3 (2f8c695). 0 new findings. Approval from R3 stands. Reviewed against 0c27224..2f8c695.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix that removes a dead authorization check and aligns the frontend with the backend's owner-only contract for message sending. The old canUpdateOtherUserChat path was a lie: the backend 403s all non-owner message submissions regardless of RBAC. Removing the false promise and making non-owner chats uniformly read-only is the right call. Proportional change (net -91 lines), and the panel confirmed the interrupt button is correctly left enabled (RBAC-gated safety operation, not owner-only).

5 P3, 4 Nit. No blockers. The P3s are test gaps (duplicate stories, untested fallback/action paths), a naming concern, and a UX copy regression. All straightforward to address.

"The old UI was a lie. The new code tells the truth: not your chat, read-only." —Hisoka

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike
ibetitsmike force-pushed the mike/fix-agents-chat-owner-banner branch from bbd75ff to 2f8c695 Compare May 27, 2026 14:40
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 of 9 findings from Round 1 addressed in 2f8c695. Nice work.

One finding is unaddressed:

CRF-8 (Nit, AgentChatPage.stories.tsx) OtherUserChatReadOnly (renamed from AdminViewingOtherUserChat) still has no canShareChat authorization mock. Since baseChatFields has no parent_chat_id, shouldCheckCanShareChat fires and MSW logs a warning for the unhandled request. The thread was resolved without a code change or response. To unblock the next review round: add the mock, respond explaining why it is unnecessary, or reopen the thread.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 9 findings from Round 1 are resolved. CRF-1 through CRF-7 and CRF-9 fixed in 2f8c695. CRF-8 contested and closed by the panel (6/6): buildQueries already provides the canShareChat mock via its embedded buildChatAuthorizationQuery call.

The fix is clean. The dead canUpdateOtherUserChat RBAC path is fully removed. Non-owner chats are uniformly read-only with clear banner text, disabled composer, and suppressed inline actions. Story coverage is thorough: name/username/fallback label paths, inline action suppression with real message fixtures, and the archived+other-user interaction are all tested.

PS. @DanielleMaywood's thread on the ChatOwnerInfo doc comment (line 57) is a style judgment call between author and human reviewer. The comment documents that {} is a valid value and explains the fallback behavior, which is useful given both fields are optional. But the type is small and the fallback logic is one hop away. Either outcome is fine.

"The old UI was a lie. The new code tells the truth: not your chat, read-only." —Hisoka, R1

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 4: Head SHA unchanged from R3 (2f8c695). No new commits, no new substantive comments. Panel re-confirmed: 0 new findings. The Round 3 approval stands.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike
ibetitsmike marked this pull request as ready for review May 27, 2026 16:09
@ibetitsmike
ibetitsmike merged commit 3cf867f into main May 27, 2026
32 of 33 checks passed
@ibetitsmike
ibetitsmike deleted the mike/fix-agents-chat-owner-banner branch May 27, 2026 16:10
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants