Skip to content

fix(ui): disable chat composer when sending is not permitted - #160977

Merged
stevenlee-oai merged 4 commits into
mainfrom
dev/stevenlee/composer-send-permissions
Sep 29, 2026
Merged

stevenlee-oai merged 4 commits into
mainfrom
dev/stevenlee/composer-send-permissions

Conversation

@stevenlee-oai

@stevenlee-oai stevenlee-oai commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Members could compose and submit messages to sessions that their sandbox requirement, shared-session policy, or other send permissions reject.

User Impact

The composer is disabled and grayed out with the reason before sending. Drafts and attachments survive access changes, and composition becomes available again when sending is permitted.

Why This Change Was Made

Session rows carry the current recipient's send restriction from the existing Gateway authorization owners. The UI uses that fact for composition and rechecks it before queued delivery, including agent-scoped global sessions. Server enforcement and independently authorized suggestion submission retain their existing behavior.

Evidence

  • Original implementation: 117 focused Gateway/UI tests passed, covering sandbox/shared-session/send policies, read-only access, draft preservation, permission changes during settings updates, and background global-session scope. The original regression failed before the fix.
  • Inspected before/after Playwright screenshots verify disabled input/Send, no send RPCs on Enter/click, retained drafts, and restored access through session updates.
  • Selected type, lint, formatting, schema, import, storage/auth, and protocol checks passed for the original implementation. The optional session-row field includes regenerated Swift models.
  • Required CI passed on the merged head f4ea8afb7fbe. GitHub records the merge at 2026-09-29 06:55 UTC as 3463f4b8e6d9. A late review concern about read-only capability inspection is documented below; its fix is not part of this merge.
  • The previously failing queued-followup fixture cleanup is fixed by upstream #160465. This PR retains that file exactly as upstream. All 43 selected Gateway/composer tests, including all 6 queued-followup cases, passed after integration.

Original changed-file single-file wall times, measured with pnpm test <file> --maxWorkers=1:

File Wall time
src/gateway/session-row-presentation.test.ts 87.71 s (cold worker bundle build)
ui/src/pages/chat/chat-composer-subagent.test.ts 14.05 s
ui/src/pages/chat/chat-send-access.test.ts 7.96 s

On the merged head, the browser CI files passed in 20.804 s (capability menu, 13 scenarios) and 4.275 s (skill library, 1 scenario).

Before and after

Restriction Before After
Sandbox required Before After
Shared session without write access Before After

Prepared follow-up — not included in this merge

The late review correctly identified that disabling the entire plus menu also removed authorized read-only Skills/Connectors inspection. Commit 7dc7f9f3495 preserves that inspection while leaving message composition, Send, attachment actions, and capability mutations permission-gated. It was pushed after this PR merged. The authorized follow-up is now #161289, based on current main; its body tracks the current validation and CI results.

The candidate passed 71 focused UI tests and all 15 browser scenarios. After the access predicate moved into its existing owner, the affected 26 UI tests and 15 browser scenarios passed again (54.68 s wall; capability-menu execution 19.772 s and skill-library execution 5.368 s). UI/E2E types, scoped lint, formatting, and fresh independent correctness and maintainability reviews passed. Remote CI has not validated this candidate.

The following inspected screenshots show the prepared follow-up, not the merged behavior. Both images render in this PR.

Before follow-up After follow-up
Before After

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M labels Sep 29, 2026
@stevenlee-oai
stevenlee-oai enabled auto-merge (squash) September 29, 2026 05:17
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 2:31 AM ET / 06:31 UTC (Revision 3).

ClawSweeper review

What this changes

The branch adds recipient-specific send restrictions to Gateway session rows and uses them to disable the web chat composer and hold queued messages when sending is denied.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

Current main still permits composition before the Gateway rejects these sends, and the submitted screenshots show the intended improvement. The PR needs one repair before merge: read-only operators lose an existing way to inspect session capabilities.

Priority: P2
Reviewed head: f4ea8afb7fbe7fcc95366e54ff27cf92cfb8a96a

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Direct visual proof and focused validation support the main behavior, but the read-only browsing regression blocks merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser images show retained drafts and disabled controls for sandbox and shared-session restrictions; the PR also reports focused mock-Gateway browser interaction checks. The images do not cover read-only capability browsing. No stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after browser images show retained drafts and disabled controls for sandbox and shared-session restrictions; the PR also reports focused mock-Gateway browser interaction checks. The images do not cover read-only capability browsing. No stored-data contract changes.
Evidence reviewed 8 items Introduced access regression: The changed return value makes composition depend entirely on send access. The composer uses that same value to disable the plus-menu trigger, which contains read-only capability views.
Existing read-only browsing contract: Current main gives read-only operators composition access separately from send access. Its browser test opens the capability menu for a read-only operator and verifies that mutations remain disabled.
Main still needs the central change: The fetched main revision retains the earlier composer-access rule, and no affected chat or session-presentation path changed between the pinned base and fetched main.
Findings 1 actionable finding [P2] Preserve read-only capability browsing
Security None None.

How this fits together

The Gateway turns session policy and the current operator's permissions into session rows for the Control UI. The browser uses those rows to present chat controls and manage queued sends; the Gateway remains the final authority for delivery.

flowchart LR
A[Role and session policy] --> B[Gateway session row]
B --> C[Control UI session state]
C --> D{Send permitted?}
D -->|No| E[Disabled input and held outbox]
D -->|Yes| F[Chat send request]
F --> G[Gateway send admission]
Loading

Before merge

  • Preserve read-only capability browsing (P2) - For an operator.read connection, this change makes canCompose false, which also disables the plus-menu trigger. Current main's browser tests use that menu to let read-only operators inspect Skills and Connectors while preventing mutations; the revised tests skip those checks. Keep sending disabled without removing the inspection path. This concern was visible on the earlier reviewed head and was missed in that cycle.
  • Resolve merge risk (P1) - Read-only operators would lose the existing plus-menu path for inspecting session skills and capabilities, although those views do not require permission to send.
  • Complete next step (P2) - Restore read-only capability and skill browsing while keeping denied message submission disabled, then update the browser coverage.

Findings

  • [P2] Preserve read-only capability browsing — ui/src/pages/chat/chat-pane-session-controls.ts:87
Agent review details

Security

None.

PR surface

Source +47, Tests +307, Docs +5, Other +4. Total +363 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 11 67 20 +47
Tests 5 325 18 +307
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 0 +4
Total 18 401 38 +363

Review metrics

Metric Value Why it matters
Code and test growth production +51, tests +307, docs +5 net lines Most growth is regression coverage; the production additions carry the new Gateway row fact through the chat UI.

Merge-risk options

Maintainer options:

  1. Preserve read-only browsing (recommended)
    Keep the plus menu available for permitted inspection while disabling message and attachment submission and retaining the existing mutation guards.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve read-only Skills and Connectors browsing in the composer plus menu while keeping denied message and attachment submission disabled; restore browser coverage that verifies browsing works and mutations remain blocked.

Technical review

Best possible solution:

Keep the Gateway's send decision authoritative, disable text and attachment submission for denied sessions, and preserve a separate read-only path into the capability menu with its mutation controls disabled.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main separates read-only composition from send permission, while the existing Gateway can deny the resulting send; the PR's before images show that mismatch. The introduced menu regression follows directly from the changed access rule and disabled trigger.

Is this the best way to solve the issue?

Mostly yes. Projecting the existing Gateway decision into the UI is a narrow repair, but using one permission value for both message entry and read-only capability browsing is too broad.

Full review comments:

  • [P2] Preserve read-only capability browsing — ui/src/pages/chat/chat-pane-session-controls.ts:87
    For an operator.read connection, this change makes canCompose false, which also disables the plus-menu trigger. Current main's browser tests use that menu to let read-only operators inspect Skills and Connectors while preventing mutations; the revised tests skip those checks. Keep sending disabled without removing the inspection path. This concern was visible on the earlier reviewed head and was missed in that cycle.
    Confidence: 0.94
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.89

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1a0e022cb1e2.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The PR addresses misleading chat controls, while its remaining regression affects a limited read-only browsing workflow.
  • merge-risk: 🚨 compatibility: The changed access rule removes previously tested read-only capability-menu access.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): Inspected before/after browser images show retained drafts and disabled controls for sandbox and shared-session restrictions; the PR also reports focused mock-Gateway browser interaction checks. The images do not cover read-only capability browsing. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after browser images show retained drafts and disabled controls for sandbox and shared-session restrictions; the PR also reports focused mock-Gateway browser interaction checks. The images do not cover read-only capability browsing. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after browser images show retained drafts and disabled controls for sandbox and shared-session restrictions; the PR also reports focused mock-Gateway browser interaction checks. The images do not cover read-only capability browsing. No stored-data contract changes.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-composer-capability-menu.e2e.test.ts ui/src/e2e/chat-skill-library.e2e.test.ts.
  • [P1] node scripts/run-vitest.mjs ui/src/pages/chat/chat-composer-subagent.test.ts.

What I checked:

  • Introduced access regression: The changed return value makes composition depend entirely on send access. The composer uses that same value to disable the plus-menu trigger, which contains read-only capability views. (ui/src/pages/chat/chat-pane-session-controls.ts:87, f4ea8afb7fbe)
  • Existing read-only browsing contract: Current main gives read-only operators composition access separately from send access. Its browser test opens the capability menu for a read-only operator and verifies that mutations remain disabled. (ui/src/e2e/chat-composer-capability-menu.e2e.test.ts:594, 2aed86671065)
  • Main still needs the central change: The fetched main revision retains the earlier composer-access rule, and no affected chat or session-presentation path changed between the pinned base and fetched main. (ui/src/pages/chat/chat-pane-session-controls.ts:87, 1a0e022cb1e2)
  • Gateway authority retained: The new row reason derives from the existing sharing and send-policy owners. The Gateway's chat pre-admission path still evaluates send policy before delivery. (src/gateway/session-row-presentation.ts:122, f4ea8afb7fbe)
  • Visible behavior proof: The four downloaded PR-body images were inspected. Both after images visibly show a disabled composer, an explanatory restriction, and a retained draft for sandbox and shared-session cases.
  • Earlier review comparison: The affected source file has the same blob identity at the earlier reviewed head and the current head, so the finding was visible in the earlier cycle. (ui/src/pages/chat/chat-pane-session-controls.ts:87, 98e99fd55c37)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • stevenlee-oai: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Restore read-only capability-menu browsing and its browser regression checks while keeping send controls disabled.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-29T05:19:52.134Z sha 0d694ae :: needs changes before merge. :: none
  • reviewed 2026-09-29T06:06:11.711Z sha 98e99fd :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@stevenlee-oai
stevenlee-oai merged commit 3463f4b into main Sep 29, 2026
257 checks passed
@stevenlee-oai
stevenlee-oai deleted the dev/stevenlee/composer-send-permissions branch September 29, 2026 06:55
@stevenlee-oai

Copy link
Copy Markdown
Contributor Author

Codex: confirmed the read-only inspection regression. The prepared fix is commit 7dc7f9f3495f6f4f18f0dcd6d01ba103fa9262ad: authorized users can still browse Skills/Connectors while text entry, Send, attachments, and capability mutations retain their guards. It restores the read-only browser coverage and passed focused UI/browser tests, type/lint checks, and fresh independent review; screenshots are in the PR body.

This PR had already merged at 06:55 UTC before the fix was pushed. The fix is therefore not included in this merge and awaits authorization for a follow-up PR. The merged head f4ea8afb7fbe passed all required CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant