Skip to content

feat(qa): trigger Mantis proof from pull requests - #126658

Merged
obviyus merged 12 commits into
mainfrom
feat/mantis-manual-short-circuit
Aug 20, 2026
Merged

obviyus merged 12 commits into
mainfrom
feat/mantis-manual-short-circuit

Conversation

@obviyus

@obviyus obviyus commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Mantis Telegram Desktop proof could only be started from Actions. The ClawSweeper proof label did not trigger it, maintainers could not invoke it from a PR comment, and clearly non-visible PRs still paid minutes of desktop setup.

Why This Change Was Made

Accept the existing ClawSweeper label and an explicit maintainer comment (@openclaw-mantis telegram desktop proof). Manual requests get a cheap, read-only Codex diff classification before desktop setup; uncertain or failed classification continues to the full free-form Mantis agent, while a definite non-visible diff upserts the canonical Mantis comment and stops.

An unprivileged dispatcher owns label/comment admission and starts the existing secret-bearing workflow through workflow_dispatch. Forks remain explicit-maintainer-only. ClawSweeper labels automatically run only same-repository PR heads.

User Impact

Maintainers can invoke native Telegram proof from a PR. ClawSweeper-selected internal PRs start automatically. Non-visible manual requests report There was nothing visible to test in this PR at all. without provisioning the desktop lane.

Authorization

The QA/Mantis owner confirms that the final exact-head dispatcher at 24457f0 may invoke the secret-bearing proof workflow for write/maintain/admin PR comments and same-repository labels applied by clawsweeper[bot]. Automatic fork-label execution remains disabled; forks require an explicit maintainer comment and exact-head approval.

Evidence

  • Focused workflow regression: 27/27 passed.

  • pnpm tsgo passed.

  • pnpm check:test-types passed.

  • actionlint and zizmor passed for the changed workflow.

  • Codex autoreview: patch correct, no accepted/actionable findings.

  • Measured prior successful Mantis run: 3m31s elapsed before the full Codex agent started; the new preflight runs before that setup.

  • Live exact-head result path: run 32380394846 passed at 24457f0 in 1m11s; the pinned Codex 0.148.0 preflight selected the no-visible path, Mantis updated its own marker comment, and both desktop jobs skipped. No desktop, Docker, credential, or artifact setup ran.

  • Spoof regression: run 32372054376 manually claimed request_source=clawsweeper_label; trusted provenance rejected the claim and still ran preflight.

  • Final-head real-user Telegram sanity: dedicated QA user sent Please answer with OPENCLAW_E2E_OK only. in a DM; one SUT reply arrived with OPENCLAW_E2E_OK, two typing events, and one correlated Responses request.

  • Label/comment ingress cannot execute this unmerged dispatcher revision: GitHub runs both issue_comment and pull_request_target from the default branch (event contract). Exact-head workflow dispatch proves the resolver, preflight, skip gate, Mantis App permission, and comment path. Focused tests cover label authorization, maintainer-comment authorization, unavailable/deleted fork metadata, and fork-label refusal.

  • Credential boundary, checked directly at the pinned sources: codex-action@52fe01e gives the upstream key only to the proxy-start step, streams it over stdin while removing PROXY_API_KEY from the proxy environment, then drops and verifies sudo before the Codex step (action.yml lines 205-228, 303-368). The Codex child inherits only that later step's environment (runCodexExec.ts lines 175-197), which contains no upstream key. Codex 0.148.0 maps read-only to no writable roots and no tool network (protocol.rs lines 1129-1134). Untrusted PR text therefore reaches a keyless Codex child; only the isolated proxy owns the authorized upstream call.

  • Exact-head ClawSweeper local review at 24457f0: passed; patch correct, zero findings, security cleared, no maintainer decision, zero Rank-up moves.

  • Exact-head CI: green. The first attempt lost its shared Blacksmith runner across multiple jobs at the same ten-minute mark; failed-only attempt 2 completed successfully with no code change.

  • Codex dependency contract personally checked against sibling openai/codex: codex-rs/exec/src/cli.rs, event_processor.rs, and both human/JSONL processors confirm --output-schema plus --output-last-message; pinned openai/codex-action source confirms those inputs feed the action's final-message output.

@clawsweeper

clawsweeper Bot commented Aug 20, 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 docs Improvements or additions to documentation size: M maintainer Maintainer-authored PR labels Aug 20, 2026
@openclaw-mantis

Copy link
Copy Markdown
Contributor

There was nothing visible to test in this PR at all.

@obviyus
obviyus marked this pull request as ready for review August 20, 2026 12:16
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 20, 2026
@clawsweeper

clawsweeper Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 20, 2026, 9:39 AM ET / 13:39 UTC.

ClawSweeper review

What this changes

Adds trusted PR-label and maintainer-comment triggers for Mantis Telegram Desktop proof, including a Codex preflight that skips desktop setup for non-visible changes.

Merge readiness

⚠️ Needs maintainer review before merge - 5 items remain

Keep open: the no-visible-result path can be blocked by any earlier commenter copying its public marker, so it may fail instead of posting Mantis’s outcome. The new secret-bearing preflight also needs the mandated direct upstream contract audit before merge.

Priority: P2
Reviewed head: fcd40c59b9bff01b04551adc6e3cedae337cb4ed

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Real downstream evidence is strong, but the marker-upsert defect and the unresolved direct dependency audit prevent a merge-ready rating.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR supplies exact-head workflow output for the no-visible path and a real Telegram sanity result; incoming GitHub event execution on an unmerged workflow is concretely infeasible and documented.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR supplies exact-head workflow output for the no-visible path and a real Telegram sanity result; incoming GitHub event execution on an unmerged workflow is concretely infeasible and documented.
Evidence reviewed 7 items Marker collision blocks the new result path: The new job selects the first PR comment containing the public marker without checking its author, then attempts to update it using the Mantis App token. A contributor can post that marker first; the app cannot edit their comment, so the job fails instead of creating Mantis’s result.
Existing publisher handles failed updates: The established Mantis evidence publisher catches a failed marker-comment update and creates a new comment, unlike the new inline upsert path.
Changed test does not cover marker ownership: The workflow test checks that the marker exists but does not exercise a contributor-owned marker preceding an app-owned comment or a failed update fallback.
Findings 1 actionable finding [P2] Only upsert the Mantis App’s marker comment
Security Needs attention Verify the preflight key and sandbox boundary: The new preflight supplies an OpenAI key to a pinned action while exposing PR-derived context; direct inspection of the action and Codex 0.148 sources is required to substantiate that the child neither inherits the key nor gains write or network capability.

How this fits together

Mantis is OpenClaw’s QA automation for proving Telegram-visible PR behavior. A PR label or authorized comment enters a dispatcher, which invokes the proof workflow; that workflow either runs Telegram Desktop proof or posts a no-visible-change result.

flowchart LR
  A[PR label or maintainer comment] --> B[Unprivileged dispatcher]
  B --> C[Permission and PR checks]
  C --> D[Proof workflow]
  D --> E[Codex visibility preflight]
  E -->|visible or uncertain| F[Telegram Desktop proof]
  E -->|non-visible| G[Mantis result comment]
Loading

Before merge

  • Only upsert the Mantis App’s marker comment (P2) - A contributor can post this public marker before Mantis does. find() then selects that foreign comment, but the Mantis App token cannot update it, so this no-visible path fails rather than creating the promised result comment. Filter for the app-owned comment and fall back to creation when an update fails.
  • Resolve security concern: Verify the preflight key and sandbox boundary - The new preflight supplies an OpenAI key to a pinned action while exposing PR-derived context; direct inspection of the action and Codex 0.148 sources is required to substantiate that the child neither inherits the key nor gains write or network capability.
  • Resolve merge risk (P1) - The no-visible-change automation can be denial-of-serviced by an earlier contributor comment containing the marker.
  • Resolve merge risk (P1) - The new preflight passes an OpenAI key alongside PR-derived context; direct pinned upstream source verification was unavailable in this review environment, so the claimed keyless child and sandbox boundary remain unverified.
  • Complete next step (P2) - The maintainer-labelled PR needs the targeted upsert repair and direct dependency-boundary verification before normal merge review can resume.

Findings

  • [P2] Only upsert the Mantis App’s marker comment — .github/workflows/mantis-telegram-desktop-proof.yml:1240-1247
  • [medium] Verify the preflight key and sandbox boundary — .github/workflows/mantis-telegram-desktop-proof.yml:219
Agent review details

Security

Needs attention: The preflight’s secret-to-Codex boundary is directly relevant but could not be independently audited because the required upstream sources were unavailable.

PR surface

Tests +79, Docs +35, Config +244. Total +358 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 89 10 +79
Docs 3 46 11 +35
Config 2 248 4 +244
Generated 0 0 0 0
Other 0 0 0 0
Total 6 383 25 +358

Review metrics

Metric Value Why it matters
Production vs test LOC production +273/-4; docs +21/-11; tests +89/-10 The workflow capability is substantial production automation growth; the added static checks do not cover the marker-owner failure path.

Merge-risk options

Maintainer options:

  1. Harden the no-visible comment upsert (recommended)
    Match only the Mantis App’s existing marker comment and create a new comment when updating it fails, with a regression case for a contributor-owned marker.
  2. Complete the pinned dependency audit
    Before merge, directly inspect the pinned codex-action and Codex 0.148 sources to verify API-key isolation and the requested read-only sandbox boundary.

Technical review

Best possible solution:

Only update a comment verified as Mantis-owned, fall back to a new comment on update failure, and add coverage for a forged earlier marker before completing the direct pinned-action and Codex sandbox audit.

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

Yes for the review finding: place the public marker in a contributor comment before Mantis’s comment, then invoke the no-visible path; source shows it selects that comment and attempts an unauthorized update.

Is this the best way to solve the issue?

No: the new inline upsert omits the existing publisher’s failed-update fallback and does not establish comment ownership before selecting a target.

Full review comments:

  • [P2] Only upsert the Mantis App’s marker comment — .github/workflows/mantis-telegram-desktop-proof.yml:1240-1247
    A contributor can post this public marker before Mantis does. find() then selects that foreign comment, but the Mantis App token cannot update it, so this no-visible path fails rather than creating the promised result comment. Filter for the app-owned comment and fall back to creation when an update fails.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: The new PR-proof workflow can fail to report its outcome on a normal contributor-controlled PR.
  • merge-risk: 🚨 automation: This PR adds GitHub event admission, workflow dispatch, and automated PR-comment behavior.
  • merge-risk: 🚨 security-boundary: The newly added preflight sends an OpenAI key to a pinned action while handling PR-derived context.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR supplies exact-head workflow output for the no-visible path and a real Telegram sanity result; incoming GitHub event execution on an unmerged workflow is concretely infeasible and documented.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies exact-head workflow output for the no-visible path and a real Telegram sanity result; incoming GitHub event execution on an unmerged workflow is concretely infeasible and documented.

Evidence

Security concerns:

  • [medium] Verify the preflight key and sandbox boundary — .github/workflows/mantis-telegram-desktop-proof.yml:219
    The new preflight supplies an OpenAI key to a pinned action while exposing PR-derived context; direct inspection of the action and Codex 0.148 sources is required to substantiate that the child neither inherits the key nor gains write or network capability.
    Confidence: 0.9

What I checked:

  • Marker collision blocks the new result path: The new job selects the first PR comment containing the public marker without checking its author, then attempts to update it using the Mantis App token. A contributor can post that marker first; the app cannot edit their comment, so the job fails instead of creating Mantis’s result. (.github/workflows/mantis-telegram-desktop-proof.yml:1240, fcd40c59b9bf)
  • Existing publisher handles failed updates: The established Mantis evidence publisher catches a failed marker-comment update and creates a new comment, unlike the new inline upsert path. (scripts/mantis/publish-pr-evidence.mjs:595, fcd40c59b9bf)
  • Changed test does not cover marker ownership: The workflow test checks that the marker exists but does not exercise a contributor-owned marker preceding an app-owned comment or a failed update fallback. (test/scripts/mantis-telegram-desktop-proof-workflow.test.ts:379, fcd40c59b9bf)
  • Current main lacks the requested dispatcher: Current main retains the manual workflow-dispatch entry point and has no dispatcher workflow or preflight request-source handling, so the requested capability is not already implemented. (.github/workflows/mantis-telegram-desktop-proof.yml:52, e71fc9420c87)
  • Security-sensitive dependency signal: The new preflight directly invokes pinned openai/codex-action with an OpenAI API key and PR-derived context, making the upstream action and Codex sandbox contracts directly relevant. (.github/workflows/mantis-telegram-desktop-proof.yml:219, fcd40c59b9bf)
  • Direct dependency audit unavailable: The required sibling Codex checkout was absent and GitHub source reads failed due DNS/network failure, so this review could not personally verify the pinned action’s key handoff or Codex 0.148 sandbox implementation.

Likely related people:

  • Ayaan Zaidi: History attributes the local Telegram Desktop proof implementation and the current request-provenance hardening to this area contributor. (role: feature introducer and recent hardening contributor; confidence: high; commits: b7b7eec5ee7b, fcd40c59b9bf; files: .github/workflows/mantis-telegram-desktop-proof.yml, .github/workflows/mantis-telegram-desktop-proof-dispatch.yml)
  • Peter Steinberger: History shows the shared Mantis request-resolution and workflow refactor that the new dispatcher extends. (role: major Mantis workflow refactor contributor; confidence: high; commits: ff10db092be5; files: .github/workflows/mantis-telegram-desktop-proof.yml, test/scripts/mantis-telegram-desktop-proof-workflow.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Filter and safely fall back from foreign marker comments, with a regression test.
  • Complete a direct audit of the pinned codex-action and Codex 0.148 source contracts.

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-20T12:34:08.400Z sha 34515f4 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-20T13:13:27.249Z sha fcd40c5 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 20, 2026
@obviyus

obviyus commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

QA/Mantis owner approval: I approve exact head fcd40c59b9bff01b04551adc6e3cedae337cb4ed to invoke the secret-bearing proof workflow from write/maintain/admin PR comments and same-repository labels applied by clawsweeper[bot]. Automatic fork-label execution remains disabled; forks require an explicit maintainer comment and exact-head approval.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 20, 2026
@obviyus
obviyus merged commit 8458777 into main Aug 20, 2026
155 checks passed
@obviyus
obviyus deleted the feat/mantis-manual-short-circuit branch August 20, 2026 14:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 21, 2026
Add trusted ClawSweeper-label and maintainer-comment dispatch for Mantis Telegram proof. Short-circuit non-visible PRs before desktop setup while preserving exact-head, fork, credential, and comment-ownership boundaries.

This branch was previously deployed

1 inactive deployment
qa-live-shared — 24457f0f Deployed Aug 20, 2026 by obviyus via Report no visible Telegram change #493327
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 merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

2 participants