Skip to content

Add MCP chat automation commands - #912

Merged
shanselman merged 1 commit into
mainfrom
issue-899-mcp-chat-automation
Jul 1, 2026
Merged

shanselman merged 1 commit into
mainfrom
issue-899-mcp-chat-automation

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Summary

  • add MCP-only native chat automation commands: app.chat.snapshot, app.chat.send, and app.chat.reset
  • wire the commands through the existing tray chat provider/gateway reset path for local Bug: user chat bubble rendering #899 repro/proof workflows
  • document the commands in winnode skill docs and MCP tool descriptions, with chat activity marked privacy-sensitive

Validation

  • python .agents\skills\autoreview\scripts\autoreview --mode local — clean, no accepted/actionable findings
  • .\build.ps1
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore — 2689 passed, 31 skipped
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore — 1452 passed
  • dotnet test .\tests\OpenClaw.WinNode.Cli.Tests\OpenClaw.WinNode.Cli.Tests.csproj --no-restore — 120 passed; existing OnnxRuntime version conflict warnings

Real behavior proof

  • launched the validated WinUI build locally and confirmed winnode --list-tools advertises app.chat.snapshot, app.chat.send, and app.chat.reset
  • invoked app.chat.reset, then app.chat.send with What's the weather in Redmond, WA
  • confirmed app.chat.snapshot contains the user entry text and weather tool calls
  • captured LVT WinUI XML showing a TextBlock with What's the weather in Redmond, WA and normal bounds
  • final proof artifacts are in the local session artifact folder under files\issue-899-mcp-chat\

CUA remains blocked for OpenClaw.Tray.WinUI approval on this host, so the current-head proof used MCP invocation plus LVT inspection instead.

Expose local MCP-only chat snapshot, send, and reset commands so agents can drive and inspect native chat state for repro/proof workflows.

Document the commands in winnode, classify chat command activity as privacy-sensitive, and cover command registration/validation in tests.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 1:18 PM ET / 17:18 UTC.

Summary
The PR adds MCP-only app.chat.snapshot, app.chat.send, and app.chat.reset commands, wires them to the native WinUI chat provider/reset path, marks chat activity privacy-sensitive, and updates winnode docs plus focused tests.

Reproducibility: not applicable. This PR adds proof/automation capability; the related chat rendering issue has one-off visible evidence but no deterministic reproduction in this review.

Review metrics: 2 noteworthy metrics.

  • MCP commands added: 3 added. The review hinges on the new snapshot/send/reset command authority, not a cosmetic code change.
  • Patch size: 7 files, +306/-2. The change is compact enough to review as one feature but spans shared capability, WinUI wiring, privacy classification, docs, and tests.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

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

Rank-up moves:

  • [P1] Add accessible current-head proof: winnode --list-tools, app.chat.reset, app.chat.send, app.chat.snapshot, and the relevant redacted LVT/XML or screenshot output.
  • Ask a maintainer to confirm whether chat snapshot/send/reset should be available to every local MCP bearer-token holder.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body claims real winnode and LVT proof, but it does not include pasted output or an accessible artifact link that this review could inspect; add redacted terminal output, logs/XML, screenshots, recordings, or linked artifacts, then update the PR body to trigger re-review.

Mantis proof suggestion
A short visible proof pass would materially help because the command sends text into native chat and the PR’s current proof artifacts are not attached. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify winnode lists app.chat.* and app.chat.send renders the sent message in native chat, with private text redacted.

Risk before merge

  • [P1] The new chat tools let any holder of the local MCP bearer token read recent chat text, send a chat message, and reset the active/default chat session; maintainers should explicitly accept that this belongs behind the existing all-or-nothing local MCP trust model.
  • [P1] The PR body’s proof is not independently inspectable because the referenced artifacts are only described as a local session folder; merge review should get pasted terminal output, redacted logs/XML, screenshots, or linked artifacts.

Maintainer options:

  1. Confirm chat authority behind local MCP
    Maintainers can accept that the existing loopback bearer-token model intentionally grants chat read/send/reset authority, then merge after accessible proof is added.
  2. Narrow or gate the chat tools
    Before merge, the PR could add an explicit chat-automation gate or split read-only snapshot from send/reset if maintainers do not want every local MCP token holder to get all three actions.
  3. Pause until proof need is clearer
    If this is only temporary repro tooling for the related rendering issue, maintainers may pause or close it and request a smaller proof harness instead.

Next step before merge

  • [P1] A maintainer should decide the local MCP chat authority boundary and require accessible proof; there is no narrow code defect for ClawSweeper to repair automatically.

Security
Cleared: No concrete implementation vulnerability was found; the sensitive local MCP chat expansion is tracked as a maintainer merge-risk decision rather than a patch defect.

Review details

Best possible solution:

Land a narrow MCP chat automation surface only after maintainers accept the local-MCP chat authority boundary and the PR includes accessible current-head winnode/MCP proof for list, reset, send, and snapshot.

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

Not applicable. This PR adds proof/automation capability; the related chat rendering issue has one-off visible evidence but no deterministic reproduction in this review.

Is this the best way to solve the issue?

Unclear. The code path is a narrow and plausible implementation, but the best solution depends on maintainer acceptance of exposing chat read/send/reset through the existing local MCP trust boundary and on adding inspectable proof.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a normal-priority MCP/chat automation improvement with limited blast radius but meaningful maintainer review needs.
  • add merge-risk: 🚨 security-boundary: The PR expands local MCP access to privacy-sensitive chat transcript data and chat side effects, which green CI does not settle as a product/security-boundary decision.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body claims real winnode and LVT proof, but it does not include pasted output or an accessible artifact link that this review could inspect; add redacted terminal output, logs/XML, screenshots, recordings, or linked artifacts, then update the PR body to trigger re-review.

Label justifications:

  • P2: This is a normal-priority MCP/chat automation improvement with limited blast radius but meaningful maintainer review needs.
  • merge-risk: 🚨 security-boundary: The PR expands local MCP access to privacy-sensitive chat transcript data and chat side effects, which green CI does not settle as a product/security-boundary decision.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body claims real winnode and LVT proof, but it does not include pasted output or an accessible artifact link that this review could inspect; add redacted terminal output, logs/XML, screenshots, recordings, or linked artifacts, then update the PR body to trigger re-review.
Evidence reviewed

What I checked:

  • Repository policy applies: AGENTS.md requires MCP/node command changes to register the command, update MCP descriptions and winnode skill docs, add appropriate tests, and prove discovery/invocation through winnode or raw MCP. (AGENTS.md:51, 4166e0fd63f8)
  • PR diff adds the command surface: The PR adds three app.chat commands to AppCapability, CommandDescriptions, App.CapabilityHandlers, NodeInvokeActivityFormatter, skill.md, and tests across 7 files with 306 additions and 2 deletions. (src/OpenClaw.Shared/Capabilities/AppCapability.cs:26, 84ed618d0603)
  • Current main does not already implement this: Searching current main found no existing app.chat.snapshot, app.chat.send, or app.chat.reset command implementation, so this PR is not obsolete on main. (4166e0fd63f8)
  • Existing MCP transport is token-gated local loopback: Current main documents and enforces loopback-only MCP with bearer-token auth before method dispatch, so the PR’s security question is the new chat authority behind that existing trust boundary, not unauthenticated remote exposure. (src/OpenClaw.Shared/Mcp/McpHttpServer.cs:29, 4166e0fd63f8)
  • Native chat provider supports background load/send state updates: Current main’s provider protects LoadAsync/SendMessageAsync state with a lock and publishes updates through the injected post callback, which makes the PR’s MCP background invocation path plausible. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs:257, 4166e0fd63f8)
  • Proof is claimed but not inspectable in the PR body: The PR body claims winnode list/call proof and LVT XML, but it points to a local session artifact folder rather than including pasted output or an accessible attachment/link for this review to inspect. (84ed618d0603)

Likely related people:

  • shanselman: Current-main blame for AppCapability, McpToolBridge, and App.CapabilityHandlers routes through the latest merged tray/MCP work, and GitHub history also shows recent WinNode CLI discovery work. (role: recent area contributor; confidence: high; commits: 4166e0fd63f8, 00dda4521698; files: src/OpenClaw.Shared/Capabilities/AppCapability.cs, src/OpenClaw.Shared/Mcp/McpToolBridge.cs, src/OpenClaw.Tray.WinUI/App.CapabilityHandlers.cs)
  • RBrid: GitHub history shows substantial recent native chat provider, reset, inline approval, and MCP-callable capability work in the same chat/MCP surface. (role: native chat feature owner; confidence: high; commits: 4e7982bafb86, 3fdfbfad837f, b0ba9affa25d; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs, src/OpenClaw.Tray.WinUI/Chat/IChatGatewayBridge.cs, src/OpenClaw.Tray.WinUI/Services/NodeInvokeActivityFormatter.cs)
  • codemonkeychris: GitHub history identifies the original winnode CLI and skill.md/MCP invocation path work, which this PR extends through new documented local MCP commands. (role: WinNode CLI adjacent owner; confidence: medium; commits: 3b8793db3702; files: src/OpenClaw.WinNode.Cli/skill.md, src/OpenClaw.WinNode.Cli/Program.cs, tests/OpenClaw.WinNode.Cli.Tests/SkillMdDriftTests.cs)
  • ranjeshj: GitHub path history for AppCapability shows the SetupEngine and app MCP integration work that introduced much of the current local MCP app-control surface. (role: app MCP/setup adjacent owner; confidence: medium; commits: cefce3952ab1; files: src/OpenClaw.Shared/Capabilities/AppCapability.cs, src/OpenClaw.Tray.WinUI/App.CapabilityHandlers.cs)
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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Jul 1, 2026
@shanselman
shanselman merged commit 14022dc into main Jul 1, 2026
19 checks passed
@shanselman
shanselman deleted the issue-899-mcp-chat-automation branch July 1, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant