Skip to content

feat(mantis): let proof agents extend desktop control - #127271

Merged
obviyus merged 4 commits into
mainfrom
fix/mantis-extensible-desktop
Aug 21, 2026
Merged

obviyus merged 4 commits into
mainfrom
fix/mantis-extensible-desktop

Conversation

@obviyus

@obviyus obviyus commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes Mantis stopping with a blocked result whenever a visible Telegram interaction is missing from its fixed primitive list, even though the recorded desktop can perform it.

Why This Change Was Made

Adds one generic desktop action seam. The proof agent writes a focused JSON sequence under its run output and can click, type, or send keys only inside the Telegram window, then continues observing and recording through the normal lane. The prompt requires using this seam before declaring a missing primitive.

The first implementation allowed shell and was rejected before proof. The final broker accepts only typed click/key/type/sleep actions, bounds clicks to the measured Telegram window, shell-quotes text, and records the action file path, hash, and timeout before execution. No profile, terminal, filesystem, or network command surface.

Production/prompt: +171/-9 (net +162). Tests: +133/-1. Growth is the generic desktop-control broker and its validation; it replaces future one-off Telegram UI primitives.

User Impact

Mantis can teach itself the UI sequence a PR needs—such as clicking an inline picker button—rather than immediately posting an unhelpful blocked proof.

Evidence

Test audit: the lane regression fails before this change because desktop is unknown; recorder coverage protects the typed window-control boundary, and failure coverage proves attempt facts persist before execution.

Performance: normal runs are unchanged. The fallback adds commands only when the agent explicitly needs extra desktop interaction.

Codex runtime checked directly: ../codex/codex-rs/exec/src/lib.rs:751-775, :885-912, and :1064-1127 confirm the output-schema, turn-start, and unprivileged sandbox behavior used by this workflow.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 21, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 21, 2026, 1:29 PM ET / 17:29 UTC.

ClawSweeper review

What this changes

The PR adds a bounded JSON-driven desktop-action broker so Mantis Telegram proof runs can perform typed clicks, keystrokes, text entry, and waits in the recorded Telegram Desktop window.

Merge readiness

⛔ Blocked by patch quality or review findings - 9 items remain

Keep open: the new raw desktop actions can leave the configured proof chat while using a shared Telegram account, enabling unintended sends or capture of another chat’s contents. The prior recorded-window binding is fixed, but it does not enforce chat ownership.

Priority: P1
Reviewed head: 22c2af3f3b39e08e1eb9e5a571ca2f1a9265c96a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has a concrete P1 security-boundary flaw despite focused mock coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate, but the supplied linked rerun does not independently prove this head’s new recorder behavior.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate, but the supplied linked rerun does not independently prove this head’s new recorder behavior.
Evidence reviewed 9 items Untrusted action intake: The lane accepts an agent-authored public JSON action file, copies it into the private session, and invokes the privileged recorder.
Missing chat boundary: The recorder validates action shape, window identity, and geometry, then permits click, key, and type actions without verifying the selected Telegram chat.
Existing scoped sibling path: The normal Telegram user driver discards updates outside its configured chat and sends, deletes, and presses only through that chat ID; desktop actions bypass this owner boundary.
Findings 1 actionable finding [P1] Constrain desktop actions to the proof chat
Security Needs attention Raw actions can escape the configured proof chat: Valid actions are limited to a Telegram window but not its active chat, allowing navigation, sends, and proof capture against another chat accessible to the shared account.

How this fits together

Mantis coordinates Telegram Desktop proof runs: an agent invokes a constrained lane, the recorder drives a leased desktop session, and the lane publishes redacted evidence for PR review.

flowchart LR
  A[Proof agent] --> B[Mantis lane]
  B --> C[Action file validation]
  C --> D[Telegram Desktop recorder]
  D --> E[Shared Telegram account]
  E --> F[Proof artifacts]
  F --> G[PR review evidence]
Loading

Decision needed

Question Recommendation
May Mantis receive generic desktop input on a shared Telegram account, or must the capability be constrained by an enforceable proof-chat boundary or a disposable account? Enforce a proof-chat boundary: Replace arbitrary desktop input with a target-chat-aware primitive and reject cross-chat navigation, sending, and capture.

Why: The source proves that the existing window guard cannot distinguish chats inside that window; choosing the acceptable authority model requires maintainer security and operational intent.

Before merge

  • Constrain desktop actions to the proof chat (P1) - The actions only bind to the outer Telegram window. An agent can click another chat in the shared QA account, then type text or send a key sequence there; the observer intentionally ignores non-configured-chat events, so the resulting send or capture is not contained by the normal proof boundary. Use a target-chat-aware action surface or a disposable account, with a regression that rejects this sequence.
  • Resolve security concern: Raw actions can escape the configured proof chat - Valid actions are limited to a Telegram window but not its active chat, allowing navigation, sends, and proof capture against another chat accessible to the shared account.
  • Resolve merge risk (P1) - Merging permits a proof agent to navigate within the valid Telegram window to another chat in the shared QA account, then send text or expose that chat through proof captures.
  • Resolve merge risk (P1) - The supplied live-run link is not tied to this head’s recorder harness, and direct sibling Codex source was unavailable for the PR’s Codex-runtime claim.
  • Complete next step (P2) - A maintainer must choose the acceptable shared-account authority model before a safe repair can be scoped.
  • Improve patch quality - Choose and implement a proof-chat authority model that cannot be bypassed by coordinate actions.
  • Improve patch quality - Add a regression for cross-chat navigation followed by input or capture rejection.
  • Improve patch quality - Attach redacted exact-head live evidence after the security repair.

Findings

  • [P1] Constrain desktop actions to the proof chat — scripts/e2e/telegram-desktop-recorder.ts:895-898
  • [high] Raw actions can escape the configured proof chat — scripts/e2e/telegram-desktop-recorder.ts:895
Agent review details

Security

Needs attention: The new desktop-input broker bypasses the proof lane’s configured-chat boundary on a shared Telegram account.

PR surface

Tests +138, Docs +10, Other +171. Total +319 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 146 8 +138
Docs 2 17 7 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 3 185 14 +171
Total 7 348 29 +319

Review metrics

Metric Value Why it matters
Production versus test delta production/prompt +171/-9 (net +162); tests +133/-1 The growth adds privileged desktop-input authority, so its ownership boundary needs explicit proof before merge.

Stored data model

Persistent data-model change detected: serialized state: scripts/e2e/telegram-mantis-lane.ts, serialized state: test/scripts/telegram-desktop-recorder.test.ts, serialized state: test/scripts/telegram-mantis-lane.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Scope desktop authority before merge (recommended)
    Implement and test an enforceable proof-chat or disposable-account boundary before enabling arbitrary click, key, and type sequences.
  2. Pause the raw-control seam
    Do not merge the generic input broker if maintainers cannot accept its shared-account authority model.

Technical review

Best possible solution:

Replace generic raw input authority with a target-chat-aware action surface or a disposable account proven to contain no non-proof chats, add a cross-chat regression, then capture redacted exact-head live proof.

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

Yes, source-reproducible: a JSON sequence can click another chat in the valid Telegram window and then issue type/key actions, while the recorder verifies no configured chat identity.

Is this the best way to solve the issue?

No: recorded-window identity fixes the earlier multi-window issue but is not a sufficient ownership boundary for a shared account containing multiple chats.

Full review comments:

  • [P1] Constrain desktop actions to the proof chat — scripts/e2e/telegram-desktop-recorder.ts:895-898
    The actions only bind to the outer Telegram window. An agent can click another chat in the shared QA account, then type text or send a key sequence there; the observer intentionally ignores non-configured-chat events, so the resulting send or capture is not contained by the normal proof boundary. Use a target-chat-aware action surface or a disposable account, with a regression that rejects this sequence.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: The branch introduces a concrete security-boundary bypass on a shared Telegram account.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • remove P2: Current review triage priority is P1, so this older priority label is no longer current.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P1: The branch introduces a concrete security-boundary bypass on a shared Telegram account.
  • merge-risk: 🚨 security-boundary: Window-only validation cannot prevent actions from navigating, sending, or capturing content in another visible Telegram chat.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate, but the supplied linked rerun does not independently prove this head’s new recorder behavior.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The action broker changes visible Telegram Desktop interaction and can send as the signed-in user.

Evidence

Security concerns:

  • [high] Raw actions can escape the configured proof chat — scripts/e2e/telegram-desktop-recorder.ts:895
    Valid actions are limited to a Telegram window but not its active chat, allowing navigation, sends, and proof capture against another chat accessible to the shared account.
    Confidence: 0.96

What I checked:

Likely related people:

  • obviyus: The PR head and the directly blamed desktop-action code are attributed to Ayaan Zaidi, and prior Mantis recorder work is present in current history. (role: recent Mantis recorder contributor; confidence: high; commits: 22c2af3f3b39, e8d2b8cb18c9; files: scripts/e2e/telegram-desktop-recorder.ts, scripts/e2e/telegram-mantis-lane.ts)

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-08-21T16:26:29.312Z sha 249d60b :: found issues before merge. :: [P2] Document the recorder's new message-sending authority
  • reviewed 2026-08-21T16:43:54.771Z sha 1d53a90 :: found issues before merge. :: [P1] Bind actions to the recorded Telegram window

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 21, 2026
@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label Aug 21, 2026
@clawsweeper clawsweeper Bot removed P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 21, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 21, 2026
@obviyus
obviyus merged commit 10a3df4 into main Aug 21, 2026
156 checks passed
@obviyus

obviyus commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@obviyus
obviyus deleted the fix/mantis-extensible-desktop branch August 21, 2026 17:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 22, 2026
* feat(mantis): let proof agents extend desktop control

* fix(mantis): constrain desktop extensions

* docs(mantis): document desktop action authority

* fix(mantis): bind actions to recorded window

This branch was previously deployed

1 inactive deployment
qa-live-shared — 22c2af3f Deployed Aug 21, 2026 by obviyus via Run agentic native Telegram proof #493375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts 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