Skip to content

fix: keep owner tools available in WebChat#101271

Merged
fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:fix/webchat-owner-tool-policy
Jul 7, 2026
Merged

fix: keep owner tools available in WebChat#101271
fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:fix/webchat-owner-tool-policy

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where authenticated owners using Control UI/WebChat could receive only restricted web/media tools when an installation configured a restrictive default sender policy.

Why This Change Was Made

Trusted owner turns on the internal WebChat channel now bypass the wildcard sender policy that is intended for unidentified external senders. External channels continue applying that wildcard policy, and plugin harnesses use the same owner-aware capability decision.

User Impact

Owners can use their configured shell, filesystem, and other tools from WebChat without granting those tools to unidentified or external senders.

Evidence

  • node scripts/test-projects.mjs src/agents/conversation-capability-profile.test.ts src/agents/harness/selection.test.ts — 68 tests passed.
  • node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-webchat-owner-final.tsbuildinfo — passed.
  • node scripts/build-all.mjs — passed.
  • Branch-mode autoreview against upstream/main reported no actionable findings.
  • Live authenticated Control UI/WebChat verification compiled 28 tools, including exec, read, write, and process, and successfully executed a shell command. Before the fix, the same WebChat session compiled 6 restricted tools.
  • Regression coverage confirms owner WebChat bypasses the wildcard sender policy while owner turns on Discord remain restricted.

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 2:56 AM ET / 06:56 UTC.

Summary
The PR exempts authenticated internal WebChat owners from wildcard toolsBySender restrictions, propagates senderIsOwner through plugin harness and /learn policy checks, and adds regression coverage for owner/non-owner and external-channel cases.

PR surface: Source +12, Tests +166. Total +178 across 7 files.

Reproducibility: yes. Source inspection shows current main always resolves sender policy and resolveToolsBySender falls back to the wildcard for sender-less WebChat owner turns; I did not run the live WebChat scenario in this read-only review.

Review metrics: 1 noteworthy metric.

  • Sender-policy semantic change: 1 wildcard exception added. toolsBySender["*"] stops applying to authenticated internal owner WebChat turns, which is the main compatibility and security-boundary question before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Have a maintainer accept, narrow, or reject the owner-WebChat wildcard-policy semantic change.
  • Rebase or refresh exact-head CI before landing because the branch is behind main.

Risk before merge

  • [P1] Existing installations that intentionally used tools.toolsBySender["*"] to restrict every WebChat turn will no longer apply that wildcard restriction to authenticated internal owner WebChat sessions.
  • [P1] The change intentionally broadens shell/filesystem/process tool availability for authenticated WebChat owners under a previously restrictive sender policy, so maintainers need to accept that security-boundary interpretation before merge.
  • [P1] The PR is mergeable but behind the base branch, so exact-head CI and review should refresh after any rebase before landing.

Maintainer options:

  1. Accept the owner-WebChat policy change (recommended)
    Land after maintainers explicitly accept the wildcard-policy semantic change and the rebased exact head is green.
  2. Narrow or document before merge
    Require a maintainer-approved contract, docs, or narrower guard if WebChat owner sessions with sender identity still need sender-policy control.
  3. Pause for policy decision
    Hold the PR if maintainers are not ready to change how toolsBySender["*"] applies to owner WebChat.

Next step before merge

  • [P2] Manual maintainer review is required because the remaining blocker is accepting a compatibility-sensitive sender-policy security boundary, not a narrow repair ClawSweeper should queue.

Maintainer decision needed

  • Question: Should authenticated internal WebChat owners bypass toolsBySender["*"] even when an existing installation used that wildcard to restrict all sender-less turns?
  • Rationale: The implementation is narrow, but it changes the security meaning of an existing policy wildcard for a trusted WebChat surface, which automation should not decide without maintainer intent.
  • Likely owner: steipete — steipete is the current assignee and the recent author/merger of the shared capability-profile and harness paths that define this policy boundary.
  • Options:
    • Accept owner WebChat bypass (recommended): Treat toolsBySender["*"] as an unidentified/external sender fallback and land this PR after exact-head gates are green.
    • Require a narrower contract: Ask for documentation or a tighter condition if some WebChat owner contexts should remain configurable through sender policy.
    • Preserve wildcard semantics: Reject or revise the PR if wildcard sender policy must continue to restrict authenticated owner WebChat by default.

Security
Cleared: No concrete security defect was found in the diff; the security-sensitive part is an intentional owner-only WebChat policy change that needs maintainer acceptance.

Review details

Best possible solution:

Land the shared capability-profile fix only after maintainers accept that wildcard sender policy is for unidentified or external senders, while keeping external channels and non-owner WebChat restricted by the new tests.

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

Yes. Source inspection shows current main always resolves sender policy and resolveToolsBySender falls back to the wildcard for sender-less WebChat owner turns; I did not run the live WebChat scenario in this read-only review.

Is this the best way to solve the issue?

Yes, with maintainer acceptance. The shared capability-profile layer is the narrow maintainable fix because core tool construction, plugin harness policy, and /learn availability all consume that policy decision; the unresolved part is the intended wildcard security contract.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR fixes a bounded owner WebChat tool-access regression for installations with restrictive sender policy, with limited blast radius.
  • merge-risk: 🚨 compatibility: The diff changes how an existing toolsBySender["*"] config behaves for authenticated owner WebChat turns.
  • merge-risk: 🚨 security-boundary: The diff intentionally broadens shell, filesystem, and process tool availability for authenticated internal WebChat owners under a previously restrictive sender policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer-labeled MEMBER PR, and the PR body nevertheless includes live authenticated WebChat before/after tool-count proof plus a shell command run.
Evidence reviewed

PR surface:

Source +12, Tests +166. Total +178 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 21 9 +12
Tests 4 172 6 +166
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 193 15 +178

What I checked:

  • Root and scoped policy read: Root AGENTS.md and src/agents/AGENTS.md were read fully; the review applied the repo guidance that sender policy, plugin harness behavior, auth/session state, and security boundaries are compatibility-sensitive. (AGENTS.md:27, e024eacf176c)
  • Current main applies sender policy unconditionally: Current main always resolves senderPolicy inside the shared capability profile, so a WebChat owner turn without a sender identity can fall through to wildcard toolsBySender. (src/agents/conversation-capability-profile.ts:209, e024eacf176c)
  • Wildcard fallback is the current source behavior: matchToolsBySenderPolicy returns the compiled wildcard when no channel/id/e164/username/name sender candidate matches. (src/config/group-policy.ts:309, e024eacf176c)
  • WebChat owners are identified by gateway admin scope: The Control UI/WebChat send path sets senderIsOwner: true for gateway-admin clients and builds the message context with the internal webchat provider/surface. (src/gateway/server-methods/chat.ts:4394, e024eacf176c)
  • PR implements the shared owner-WebChat exception: At the PR head, resolveConversationCapabilityProfile skips sender policy only when senderIsOwner is true and the normalized provider or message channel is the internal WebChat channel. (src/agents/conversation-capability-profile.ts:211, eba344e32bc4)
  • Plugin harness and /learn paths receive owner identity: The PR passes senderIsOwner into the plugin harness capability-profile resolver and into the /learn workshop availability check, avoiding a one-sided core-tool-only fix. (src/agents/harness/selection.ts:467, eba344e32bc4)

Likely related people:

  • steipete: Current blame for the shared capability-profile, plugin-harness policy path, and WebChat sender-owner propagation points to the merged refactor(codex): raise app-server floor to 0.142, drop range compat, fix deferred spawn_agent steering #101221 refactor authored and merged by steipete; the live PR is also assigned to steipete. (role: recent area contributor and current assignee; confidence: high; commits: e5798e547770; files: src/agents/conversation-capability-profile.ts, src/agents/harness/selection.ts, src/gateway/server-methods/chat.ts)
  • fuller-stack-dev: Beyond authoring this PR, fuller-stack-dev has prior merged WebChat gateway work in feat(gateway): persist webchat inbound images to disk #51324 touching the same gateway chat surface. (role: recent adjacent WebChat contributor; confidence: medium; commits: c9449d77b40a; files: src/gateway/server-methods/chat.ts)
  • obviyus: obviyus merged the prior WebChat image persistence PR and authored follow-up commits in that gateway chat path, making them relevant for adjacent WebChat behavior context. (role: adjacent merger/reviewer; confidence: medium; commits: 7a22cc1592de, 2e72ff2a659e; files: src/gateway/server-methods/chat.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-07T02:36:33.533Z sha 1e475c5 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 7, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Land-ready maintainer review complete.

Canonical-fix verdict: this PR is the best-fit fix. The owner exception remains at the resolved sender-policy boundary, applies only to authenticated internal WebChat owner turns, and does not bypass global, agent, group, sandbox, subagent, or inherited tool policy. External-channel owners and non-owner/untrusted WebChat contexts remain restricted.

Bounded preparation also propagated senderIsOwner through the /learn capability preflight and added positive and negative coverage for the direct agent tool surface, capability profile, plugin harness, and /learn.

Prepared head: eba344e32bc4d88a8f662f6e4b27be7ec8adfdc4

Evidence:

  • Blacksmith Testbox tbx_01kwxm6tc3cwy9fwq29y5jmhqh: 4 focused files, 104 tests passed.
  • Control UI/WebChat GUI flow: 1 selected end-to-end test passed.
  • Autoreview: no accepted or actionable findings.
  • Exact-head CI: run 28847175271 passed, including lint, build, type checks, security checks, QA smoke, and all Node shards.
  • Exact-head Workflow Sanity: run 28847175221 passed.
  • The pushed tree exactly matches reviewed local preparation commit e89ff6239e760509ac598ffc01df038a289e7b32.

The old-head lint and compact-shard failures were stale-base failures and both pass on the prepared exact head. No rebase or force-push was used.

Proof gap: no screenshot was captured because the authorization result is a runtime tool-schema boundary rather than visible UI state; the GUI message flow and direct owner/non-owner tool assertions cover the behavior.

@fuller-stack-dev
fuller-stack-dev merged commit c87225f into openclaw:main Jul 7, 2026
109 of 111 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/webchat-owner-tool-policy branch July 7, 2026 07:00
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
* fix: keep owner tools available in WebChat

* fix: align WebChat owner policy checks
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
* fix: keep owner tools available in WebChat

* fix: align WebChat owner policy checks
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
* fix: keep owner tools available in WebChat

* fix: align WebChat owner policy checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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