Skip to content

fix: keep WebChat permissions after an agent hands back a chat - #201160

Merged
VACInc merged 2 commits into
mainfrom
openclaw/keen-crab
Nov 18, 2026
Merged

VACInc merged 2 commits into
mainfrom
openclaw/keen-crab

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related: #201015

What Problem This Solves

After an agent handed back a dashboard chat, a user's next message could schedule a job but still couldn't read an otherwise permitted channel, react to the current prompt, or start a worker that needs the user's repository access. WebChat was still checking who started the conversation instead of who sent that message.

User Impact

Users keep their existing permissions when they take over a dashboard chat. Messages coming from Discord, Slack, Telegram or another channel continue to follow that channel's rules. No role, setting or migration changes.

Why This Change Was Made

The WebChat entry point now makes one decision about whether the current input came directly from an authenticated user after parent control ended. Each feature still checks its own permissions. The scheduling exception remains limited to the caller's own jobs. No channel adapter changed.

Evidence

A regression test sent a fresh message through chat.send in an existing, previously spawned dashboard chat. It failed on main and passed with the fix. The test checks the channel-read permission, reaction binding, and repository dispatch, including loss of access when the turn ends. Separate tests keep channel-origin messages, non-WebChat clients, supervised children, and internal messages outside the exception. Discord and Slack read-permission tests, Telegram inbound authorization, and the shared channel and repository suites passed. Type checks, lint, and formatting passed. No live channel messages were sent or external workers launched.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 2 commits November 18, 2026 11:27
Worked on by:
- @VACInc

Co-authored-by: VACInc <[email protected]>
OpenClaw-Publication: 94bc88bc-cc23-8c04-95a1-484af4c6f75b
@clawsweeper

clawsweeper Bot commented Nov 18, 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.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 54f4ac05b3efc7bd57de1cbf84b4cbe88cf7522f
  • Maintainer: @roboclaw-bot
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/server-methods/cron-creator-authority-admission.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR restores existing caller permissions for fresh WebChat messages after an agent releases a spawned dashboard chat.

Example: A user with operator.write sends a fresh message in agent:main:dashboard:binding after its parent releases control.

  • Before: Scheduling works, but historical spawnedBy metadata prevents dashboard channel-read and reaction authority and repository dispatch context.
  • After: The message receives the existing caller-bound capabilities while scheduling remains limited to the caller's own jobs.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch appears correct and useful, but the supplied harness validation does not establish the changed user-visible behavior.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A user taking over an agent-created dashboard chat loses otherwise permitted channel reads, prompt reactions, and repository-backed worker access.
Reason: The maintainer-authored direction restores established caller permissions through the existing admission boundary.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs a current permission mismatch using the existing admission owner; no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 54f4ac05b3efc7bd57de1cbf84b4cbe88cf7522f

Before merge

None.

Findings

None.

Tests

  • Low-value test src/gateway/server-methods/chat-send-session-binding.test.ts: Remove the added repositoryScope call-count assertion and its spy setup: invocation alone does not verify repository credential admission or a successful repository operation.
  • Missing end-to-end proof: Show a fresh operator.write message in a handed-off dashboard chat completing an allowed channel read, prompt reaction, and repository-backed dispatch through a running Gateway and agent, with sensitive values redacted.
Agent review details

How this fits together

Gateway chat admission combines authenticated client identity, input provenance, session control, and scopes into capabilities consumed by message actions and repository dispatch.

flowchart TD
  A[Authenticated WebChat message] --> B[Gateway chat admission]
  C[Session lineage and live controller] --> B
  B --> D[Shared direct input classification]
  D --> E[Dashboard reads and prompt reactions]
  D --> F[Repository dispatch]
  D --> G[Caller scoped scheduling]
Loading

Technical review

Best possible solution:

Use the shared direct-input classifier to distinguish fresh authenticated dashboard input from spawn history while preserving each capability owner's existing permission checks.

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

Current-main source establishes the spawnedBy rejection and its affected consumers, and the author reports a red/green chat.send regression; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch fixes the shared classification mismatch with a reused helper and existing authority owners, without adding state, another dispatch path, or broader scheduling privileges.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5ef0e2fb9894.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Shakker: Raw commit 9ace0a5 adds src/gateway/server-methods/cron-creator-authority-admission.ts:46 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9ace0a571f41; files: src/gateway/server-methods/cron-creator-authority-admission.ts)
  • RoboClaw: Raw commit 9c105a4 adds src/gateway/server-methods/cron-creator-authority-admission.ts:73 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9c105a4e1a65; files: src/gateway/server-methods/cron-creator-authority-admission.ts)
  • Josh Avant: Raw commit a345ede adds src/gateway/server-methods/cron-creator-authority-admission.ts:14 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a345ede6851c; files: src/gateway/server-methods/cron-creator-authority-admission.ts)
  • Peter Steinberger: Raw commit 1c798b4 adds src/gateway/server-methods/cron-creator-authority-admission.ts:52 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 1c798b4be1af; files: src/gateway/server-methods/cron-creator-authority-admission.ts)

PR surface

Source +6, Tests +46. Total +52 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 19 13 +6
Tests 2 51 5 +46
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 70 18 +52

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Existing permissions fail in handed-off dashboard chats, with a limited blast radius outside ordinary chat admission.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Existing permissions fail in handed-off dashboard chats, with a limited blast radius outside ordinary chat admission.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 18, 2026, 6:43 AM ET / 11:43 UTC.

@VACInc
VACInc merged commit 6122ae9 into main Nov 18, 2026
131 checks passed
@VACInc
VACInc deleted the openclaw/keen-crab branch November 18, 2026 13:14
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…law#201160)

* fix: keep WebChat permissions after an agent hands back a chat

Co-authored-by: VACInc <[email protected]>

* fix: keep WebChat permissions after an agent hands back a chat

Worked on by:
- @VACInc

Co-authored-by: VACInc <[email protected]>
OpenClaw-Publication: 94bc88bc-cc23-8c04-95a1-484af4c6f75b

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: VACInc <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
* fix: keep WebChat permissions after an agent hands back a chat

Co-authored-by: VACInc <[email protected]>

* fix: keep WebChat permissions after an agent hands back a chat

Worked on by:
- @VACInc

Co-authored-by: VACInc <[email protected]>
OpenClaw-Publication: 94bc88bc-cc23-8c04-95a1-484af4c6f75b

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: VACInc <[email protected]>

(cherry picked from commit 6122ae9)

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. security-sensitive-changed size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants