Repository navigation
feat(mantis): let proof agents extend desktop control - #127271
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 21, 2026, 1:29 PM ET / 17:29 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherMantis 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]
Decision needed
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
Findings
Agent review detailsSecurityNeeds attention: The new desktop-input broker bypasses the proof lane’s configured-chat boundary on a shared Telegram account. PR surfaceTests +138, Docs +10, Other +171. Total +319 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0a861b40eef3. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
|
Merged via squash.
|
* 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
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
desktopaction 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
pnpm tsgo:scripts: passed.pnpm tsgo:test:root: passed.Test audit: the lane regression fails before this change because
desktopis 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-1127confirm the output-schema, turn-start, and unprivileged sandbox behavior used by this workflow.