Skip to content

fix(ci): bound Telegram Mantis proof cleanup - #115253

Merged
steipete merged 3 commits into
mainfrom
codex/fix-mantis-proof-cleanup
Jul 28, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/fix-mantis-proof-cleanup

Conversation

@steipete

@steipete steipete commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the Telegram Desktop Mantis workflow could hang during privileged SUT teardown and then fail to upload otherwise useful evidence when a root-owned session file remained in the proof directory. Run 30362895350 reproduced both failures: the stop wrapper ignored normal termination, and actions/upload-artifact later failed with EACCES on baseline/session.json.

Why This Change Was Made

The privileged wrapper now runs stop/destroy cleanup beneath its own 30-second timeout supervisor. That supervisor owns the cleanup process group, so TERM/KILL escalation reaches Docker and network-cleanup descendants instead of killing only the unprivileged caller's sudo process. Internal cleanup entry points reject direct execution outside that supervisor, and Bash re-executes the tracked wrapper regardless of its checkout file mode.

After credential release and root-owned attestation validation finish, the workflow returns only the proof output directory to the runner before manifest inspection and upload. Immutable worktrees and SUT attestations remain root-owned.

User Impact

No product behavior changes. Maintainers get bounded Telegram proof cleanup and readable evidence artifacts even when a capture attempt fails, making live-proof failures diagnosable instead of losing the manifest to a second upload error.

Evidence

  • Live failure: Mantis run 30362895350 recorded a stuck privileged stop and EACCES while zipping baseline/session.json.
  • Focused local proof after Blacksmith Testbox remained capacity-queued: node scripts/run-vitest.mjs test/scripts/telegram-user-crabbox-proof.test.ts test/scripts/mantis-telegram-desktop-proof-workflow.test.ts — 65 tests passed.
  • Workflow/shell validation: bash -n, shellcheck, actionlint, node scripts/check-workflows.mjs, and git diff --check passed.
  • Fresh Codex autoreview on exact head b8aacf2f488: clean, no accepted/actionable findings, 0.96 confidence. Earlier reviews correctly moved the deadline from the caller to the privileged owner and required Bash re-execution for the tracked non-executable script.

AI-assisted: yes. I reviewed the privileged process-group cleanup, credential-release ordering, attestation boundary, artifact ownership, tests, workflow checks, and final autoreview.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Jul 28, 2026
@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 backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 11:30 AM ET / 15:30 UTC.

ClawSweeper review

What this changes

This PR makes the privileged Telegram Mantis cleanup wrapper enforce a 30-second process-group deadline and returns proof artifacts to the runner before manifest inspection and upload.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open for human merge review. The proposed timeout ownership and proof-directory handoff are narrowly scoped to the Telegram Mantis workflow, and the supplied focused tests plus CI checks support the patch, but the PR body provides only a pre-fix live failure and mock/test validation—not an after-fix real workflow run showing both bounded privileged cleanup and successful artifact upload. The maintainer label also requires explicit maintainer handling.

Priority: P2
Reviewed head: b8aacf2f488d2ec3122ef267f93ca5052331520c

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and has meaningful regression coverage, but its real behavior proof is limited to tests and checks rather than the privileged workflow it changes.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR contains focused tests and CI/workflow validation plus a linked pre-fix failure, but no after-fix real Mantis workflow evidence showing both bounded cleanup and successful artifact upload; add redacted live output, logs, or a workflow artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR contains focused tests and CI/workflow validation plus a linked pre-fix failure, but no after-fix real Mantis workflow evidence showing both bounded cleanup and successful artifact upload; add redacted live output, logs, or a workflow artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Privileged cleanup boundary: The branch adds a timeout-supervised re-exec path for stop and destroy, with internal actions rejecting direct invocation unless their parent is the timeout binary. This preserves a bounded owner for descendant cleanup rather than timing out only the unprivileged caller.
Artifact handoff ordering: The workflow returns ownership of only MANTIS_OUTPUT_DIR after cleanup and before evidence-manifest inspection, addressing the reported upload EACCES without changing the stated root-owned attestation boundary.
Focused regression coverage: The branch test checks that the ownership handoff occurs after lease cleanup and before manifest inspection, and verifies the timeout re-exec and parent-supervisor guard are present in the shell wrapper.
Findings None None.
Security None None.

How this fits together

The Telegram Mantis proof workflow runs a privileged container wrapper to create and tear down an isolated Telegram test environment, then inspects and uploads the captured proof. This PR changes the cleanup-to-artifact boundary so a hung teardown cannot indefinitely stall the workflow or leave upload artifacts unreadable.

flowchart LR
  A[Telegram proof workflow] --> B[Privileged cleanup wrapper]
  B --> C[Timeout supervisor]
  C --> D[Docker and network cleanup]
  A --> E[Proof output directory]
  E --> F[Runner ownership handoff]
  F --> G[Manifest inspection and artifact upload]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR contains focused tests and CI/workflow validation plus a linked pre-fix failure, but no after-fix real Mantis workflow evidence showing both bounded cleanup and successful artifact upload; add redacted live output, logs, or a workflow artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - A successful unit/workflow-check run does not demonstrate that GitHub-hosted privileged cleanup terminates Docker and network descendants within the deadline or that the subsequent artifact upload can read every returned proof file.
  • Resolve merge risk (P1) - The branch is behind main; refresh the merge result and rerun the real workflow evidence on the exact reviewed head before landing.
  • Complete next step (P2) - The remaining gate is contributor-provided real workflow proof and a protected-label maintainer merge decision, not a narrow mechanical repair for an automated worker.
Agent review details

Security

None.

PR surface

Tests +18, Config +9, Other +22. Total +49 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 19 1 +18
Docs 0 0 0 0
Config 1 9 0 +9
Generated 0 0 0 0
Other 1 22 0 +22
Total 3 50 1 +49

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Prove the live cleanup path before merge (recommended)
    Rebase the branch and provide a redacted after-fix Mantis workflow run showing bounded privileged teardown followed by successful manifest inspection and artifact upload.
  2. Accept CI-only validation
    A maintainer may merge based on the focused tests and checks while explicitly accepting that the privileged runner behavior has not yet been demonstrated after the change.

Technical review

Best possible solution:

Run the Telegram Mantis workflow on the exact rebased head, intentionally exercise or capture the cleanup path, and attach redacted evidence that the timeout completes teardown and that manifest inspection plus artifact upload succeed.

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

No high-confidence current-main reproduction was independently established in this review. The PR links a concrete prior workflow failure and adds focused coverage, but the available evidence does not show a fresh reproduction or after-fix live run on the current merge result.

Is this the best way to solve the issue?

Unclear. Moving the deadline to the privileged process-group owner and returning only the proof output after cleanup are the right apparent boundaries, but a real workflow run is still needed to confirm this is the best operational fix.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a bounded CI proof and artifact-collection failure with limited blast radius rather than a user-facing runtime outage.
  • add merge-risk: 🚨 automation: The patch changes privileged cleanup and artifact-upload ownership in a GitHub Actions proof workflow, where a live runner result is needed to validate the automation path.
  • 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 real behavior proof before merge: The PR contains focused tests and CI/workflow validation plus a linked pre-fix failure, but no after-fix real Mantis workflow evidence showing both bounded cleanup and successful artifact upload; add redacted live output, logs, or a workflow artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This repairs a bounded CI proof and artifact-collection failure with limited blast radius rather than a user-facing runtime outage.
  • merge-risk: 🚨 automation: The patch changes privileged cleanup and artifact-upload ownership in a GitHub Actions proof workflow, where a live runner result is needed to validate the automation path.
  • 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 real behavior proof before merge: The PR contains focused tests and CI/workflow validation plus a linked pre-fix failure, but no after-fix real Mantis workflow evidence showing both bounded cleanup and successful artifact upload; add redacted live output, logs, or a workflow artifact before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Privileged cleanup boundary: The branch adds a timeout-supervised re-exec path for stop and destroy, with internal actions rejecting direct invocation unless their parent is the timeout binary. This preserves a bounded owner for descendant cleanup rather than timing out only the unprivileged caller. (scripts/mantis/mantis-sut-container.sh:17, b8aacf2f488d)
  • Artifact handoff ordering: The workflow returns ownership of only MANTIS_OUTPUT_DIR after cleanup and before evidence-manifest inspection, addressing the reported upload EACCES without changing the stated root-owned attestation boundary. (.github/workflows/mantis-telegram-desktop-proof.yml:556, b8aacf2f488d)
  • Focused regression coverage: The branch test checks that the ownership handoff occurs after lease cleanup and before manifest inspection, and verifies the timeout re-exec and parent-supervisor guard are present in the shell wrapper. (test/scripts/mantis-telegram-desktop-proof-workflow.test.ts:148, b8aacf2f488d)
  • Proof gap: The PR body links a real pre-fix failure in workflow run 30362895350, but its after-fix evidence is focused Vitest and workflow/shell checks. It does not provide a real after-fix Mantis run proving deadline escalation and readable artifact upload together. (b8aacf2f488d)
  • Repository policy applied: The supplied repository AGENTS.md treats workflow automation and privileged proof cleanup as safety-sensitive, requires focused proof for the touched surface, and requires human handling for protected maintainer items. (AGENTS.md:1, 58a3679c4923)

Likely related people:

  • steipete: The available PR history shows three successive commits refining the Telegram Mantis cleanup wrapper and its regression coverage; broader current-main ownership history could not be established from the provided read-only execution environment. (role: recent area contributor; confidence: low; commits: e8d314ef6aa7, 0bcc6ce5ef93, b8aacf2f488d; files: scripts/mantis/mantis-sut-container.sh, .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.

  • Attach redacted after-fix evidence from a real Mantis workflow run, including cleanup completion and successful artifact upload.
  • Rebase onto current main and refresh the live proof on the exact head.

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.

@steipete
steipete merged commit 3224005 into main Jul 28, 2026
120 of 125 checks passed
@steipete
steipete deleted the codex/fix-mantis-proof-cleanup branch July 28, 2026 15:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 28, 2026
…-20260728

* origin/main:
  fix(ci): bound Telegram Mantis proof cleanup (#115253)
  fix(scripts): materialize PR worktrees before gates (#115120)
  perf(catalog): cadence-proof provider caches and parallelize the Claude scan (#115259)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
* test(mantis): bound Telegram proof cleanup

* test(mantis): enforce cleanup deadline in wrapper

* test(mantis): supervise cleanup through bash

This branch had an error being deployed

1 failed deployment
qa-live-shared — b8aacf2f Deployed Jul 28, 2026 by steipete via Run agentic native Telegram proof #493251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: S 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