Skip to content

feat(repair): enable leased Telegram E2E proof - #1281

Merged
obviyus merged 6 commits into
mainfrom
codex/telegram-userbot-proof
Aug 28, 2026
Merged

obviyus merged 6 commits into
mainfrom
codex/telegram-userbot-proof

Conversation

@obviyus

@obviyus obviyus commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Pass the Convex QA broker settings only to OpenClaw execution workers.
  • Replace the Telegram Mantis route with proof: telegram-e2e and the repository skill.
  • Remove legacy Telegram proof labels during normal synchronization.
  • Keep Mantis recommendations limited to Discord and web UI chat.

Depends on openclaw/openclaw#131715.

Authority boundary

OpenClaw execution workers intentionally receive the Convex CI lease credential. This is required so an agent can use the repository Telegram skill freely while it investigates any OpenClaw pull request. The worker is the trusted boundary; there is no scenario planner, proof daemon, protected socket, or fixed-command broker.

The credential grants access only to the QA lease broker. The broker returns Telegram Test Server fixtures under exclusive, expiring leases. It does not grant production Telegram access. The workflow does not expose the credential to non-OpenClaw targets or other workflow steps. Target validation commands still run with secrets removed.

Label cutover

The synchronization path treats mantis: telegram-visible-proof as a migration-only legacy label. It adds proof: telegram-e2e when proof is still required, then removes the old label. It removes the old label without replacement when proof is no longer required.

Source-revision guards ignore both bot-owned names during the migration, so cleanup cannot invalidate an existing trusted review command. The dashboard reads both names until synchronization has migrated the remaining pull requests.

Validation

  • ClawSweeper build, repair build, and dashboard build passed.
  • All 153 selected unit tests passed on the current head, including the live dashboard-query migration test.
  • Formatting and git diff --check passed.
  • Workflow tests prove the Convex settings reach only the OpenClaw execution step.

The dependent OpenClaw branch passed a live 10-worker Test Server run: 10 replies, 10 provider requests, and zero leftover leases or processes. The ClawSweeper deployment must land first so those workers can discover and use the repository skill.

OpenClaw Bay is not affected. This changes worker environment and proof routing, not Bay data or controls.

@obviyus
obviyus requested a review from a team as a code owner August 28, 2026 10:04
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 8:05 AM ET / 12:05 UTC.

ClawSweeper review

What this changes

This branch replaces Telegram Mantis routing with a Telegram E2E-proof label, migrates legacy labels, and passes QA lease-broker settings to OpenClaw repair workers.

Merge readiness

⛔ Blocked until real behavior proof is added - 7 items remain

Keep open: the new label is not consumed by repair execution, and the introduced workflow supplies the QA broker secret to every executing OpenClaw repair rather than a label-gated Telegram proof action.

Priority: P1
Reviewed head: cd03380c970dd2d8525c2ae904307f1f340f68dc

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The branch has focused migration coverage, but missing real authority proof and two P1 execution-boundary defects make it unready to merge.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: Authority-chain proof required: the body reports a dependent Test Server run but supplies no redacted trace or artifact showing a permitted label-gated broker call and an unrelated repair denied before broker I/O. 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 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Authority-chain proof required: the body reports a dependent Test Server run but supplies no redacted trace or artifact showing a permitted label-gated broker call and an unrelated repair denied before broker I/O. 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 Introduced credential exposure: The new environment expressions are gated only by the target repository slug and generic repair-execution conditions, so every eligible OpenClaw repair invocation receives the QA broker site URL and secret.
Credential reaches the free-form repair agent: The existing subprocess environment begins with the full worker environment and does not remove either introduced OPENCLAW_QA_CONVEX variable before spawning Codex.
No executable label consumer: The introduced label-selection path adds proof: telegram-e2e, but the source search found no repair-worker dispatch or validation path that consumes that label; the prompt's assertion that it tells the execution worker to use the skill is therefore not implemented.
Findings 2 actionable findings [P1] Restrict QA lease credentials to Telegram proof work
[P1] Connect the Telegram E2E label to execution
Security Needs attention Unrelated repair jobs receive the lease credential: The target-slug condition does not distinguish Telegram proof work from ordinary OpenClaw repairs, and the repair subprocess deliberately retains the secret, so the nearest unauthorized repair principal can reach the broker capability.

How this fits together

ClawSweeper labels PR proof needs, then its repair workflow runs Codex against selected target repositories. This change connects Telegram proof labeling, the repair worker environment, and dashboard proof-triage views.

flowchart LR
  A[PR review result] --> B[Telegram proof label]
  B --> C[Repair workflow]
  C --> D[OpenClaw target check]
  D --> E[Codex repair session]
  E --> F[QA lease broker]
  B --> G[Dashboard proof view]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Authority-chain proof required: the body reports a dependent Test Server run but supplies no redacted trace or artifact showing a permitted label-gated broker call and an unrelated repair denied before broker I/O. 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.
  • Restrict QA lease credentials to Telegram proof work (P1) - The added expressions are true for every eligible openclaw/openclaw repair, and codexSubprocessEnv preserves both variables into the free-form Codex process. Persist and validate a dedicated Telegram-proof action, then inject these values only for that action; an unrelated repair must be rejected before broker I/O.
  • Connect the Telegram E2E label to execution (P1) - This adds proof: telegram-e2e during label synchronization, but no repair workflow or worker code consumes it to invoke telegram-e2e-userbot; the new prompt claim therefore cannot occur. Add a validated dispatch path and focused test from label through skill invocation.
  • Resolve security concern: Unrelated repair jobs receive the lease credential - The target-slug condition does not distinguish Telegram proof work from ordinary OpenClaw repairs, and the repair subprocess deliberately retains the secret, so the nearest unauthorized repair principal can reach the broker capability.
  • Resolve merge risk (P1) - Merging would give an unrelated OpenClaw repair agent the QA lease-broker secret, allowing broker access before any Telegram-proof eligibility decision.
  • Resolve merge risk (P1) - Selecting proof: telegram-e2e currently changes labels and presentation only; it cannot cause the promised repository E2E skill to run.
  • Complete next step (P2) - The contributor must repair the credential boundary and supply real authority-chain proof; this is not a safe automated handoff.

Findings

  • [P1] Restrict QA lease credentials to Telegram proof work — .github/workflows/repair-cluster-worker.yml:668-669
  • [P1] Connect the Telegram E2E label to execution — src/clawsweeper-label-selection.ts:126
  • [medium] Unrelated repair jobs receive the lease credential — .github/workflows/repair-cluster-worker.yml:669
Agent review details

Security

Needs attention: The introduced workflow broadens access to a QA lease credential beyond a proven Telegram-proof authority boundary.

Review metrics

Metric Value Why it matters
Changed surface 23 files; production/docs +45/-40, tests +163/-26 The change spans credential delivery, label synchronization, review policy, and dashboard projection, so the missing execution link affects several coordinated surfaces.

Merge-risk options

Maintainer options:

  1. Gate and dispatch Telegram proof (recommended)
    Add a validated Telegram E2E proof action that alone receives the lease capability, then connect the label to that action and prove denial for unrelated repairs.
  2. Pause the route replacement
    Do not merge the new label and credential path until the repair worker has a least-privilege execution boundary.

Technical review

Best possible solution:

Persist and validate a dedicated Telegram E2E proof action, inject the broker capability only for that action, and prove both allowed broker recovery and denial of an unrelated repair before any broker request.

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

Yes, from source: an unrelated eligible OpenClaw repair follows the same workflow condition and inherits the broker variables into Codex. A controlled runtime trace is still needed to demonstrate broker denial before I/O.

Is this the best way to solve the issue?

No. The label migration is incomplete until a validated proof action consumes it and credential delivery is limited to that action.

Full review comments:

  • [P1] Restrict QA lease credentials to Telegram proof work — .github/workflows/repair-cluster-worker.yml:668-669
    The added expressions are true for every eligible openclaw/openclaw repair, and codexSubprocessEnv preserves both variables into the free-form Codex process. Persist and validate a dedicated Telegram-proof action, then inject these values only for that action; an unrelated repair must be rejected before broker I/O.
    Confidence: 0.99
  • [P1] Connect the Telegram E2E label to execution — src/clawsweeper-label-selection.ts:126
    This adds proof: telegram-e2e during label synchronization, but no repair workflow or worker code consumes it to invoke telegram-e2e-userbot; the new prompt claim therefore cannot occur. Add a validated dispatch path and focused test from label through skill invocation.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The proposed repair-worker authority path can affect live automated work on OpenClaw pull requests.
  • merge-risk: 🚨 security-boundary: The introduced workflow exposes a broker credential to every eligible OpenClaw repair instead of a proven least-privilege proof action.
  • merge-risk: 🚨 automation: The new proof label is not wired to an executable E2E path, so automation cannot perform the behavior it advertises.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: the body reports a dependent Test Server run but supplies no redacted trace or artifact showing a permitted label-gated broker call and an unrelated repair denied before broker I/O. 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

Security concerns:

  • [medium] Unrelated repair jobs receive the lease credential — .github/workflows/repair-cluster-worker.yml:669
    The target-slug condition does not distinguish Telegram proof work from ordinary OpenClaw repairs, and the repair subprocess deliberately retains the secret, so the nearest unauthorized repair principal can reach the broker capability.
    Confidence: 0.99

What I checked:

  • Introduced credential exposure: The new environment expressions are gated only by the target repository slug and generic repair-execution conditions, so every eligible OpenClaw repair invocation receives the QA broker site URL and secret. (.github/workflows/repair-cluster-worker.yml:668, cd03380c970d)
  • Credential reaches the free-form repair agent: The existing subprocess environment begins with the full worker environment and does not remove either introduced OPENCLAW_QA_CONVEX variable before spawning Codex. (src/repair/process-env.ts:18, cd03380c970d)
  • No executable label consumer: The introduced label-selection path adds proof: telegram-e2e, but the source search found no repair-worker dispatch or validation path that consumes that label; the prompt's assertion that it tells the execution worker to use the skill is therefore not implemented. (src/clawsweeper-label-selection.ts:126, cd03380c970d)
  • Tests confirm broad delivery, not least privilege: The new workflow test asserts that credentials reach the OpenClaw execution step and no other workflow step, but it does not establish that a non-Telegram OpenClaw repair is rejected before broker I/O. (test/repair/cluster-workflow-security.test.ts:317, cd03380c970d)
  • Relevant history: Repair execution and containment were substantially maintained by Peter Steinberger before this PR; the authority-review surface was added by joshavant. The current workflow exposure dates to this PR's commit 290ed79. (.github/workflows/repair-cluster-worker.yml:668, 290ed7909460)

Likely related people:

  • Peter Steinberger: Prior main-branch commits established the repair execution and subprocess-containment paths affected by the workflow environment change. (role: repair execution and containment contributor; confidence: high; commits: 9ab7ed40220a, 145f3d6ab0b2; files: .github/workflows/repair-cluster-worker.yml, src/repair/process-env.ts)
  • joshavant: Introduced the authority delivery-chain review surface relevant to this newly broadened repair-worker credential capability. (role: authority-review feature contributor; confidence: medium; commits: 868eb60db2fb; files: prompts/review-item.md)
  • Vincent Koc: Recent main history includes proof-result and dashboard work adjacent to the updated Telegram proof view. (role: recent dashboard proof-triage contributor; confidence: medium; commits: d103c0cf5c98; files: dashboard/worker.ts)

Rank-up moves

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

  • Limit the broker environment to a validated Telegram E2E proof action and assert that ordinary OpenClaw repairs do not receive it.
  • Add a redacted after-fix trace proving the allowed action recovers through the broker and the nearest unrelated repair is rejected before I/O; update the PR body for re-review.

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 (3 earlier review cycles)
  • reviewed 2026-08-28T10:07:35.173Z sha 33f7115 :: needs real behavior proof before merge. :: [P1] Restrict QA credentials to the actual Telegram proof invocation | [P1] Implement the promised Telegram E2E dispatch | [P1] Migrate the previous Telegram proof label
  • reviewed 2026-08-28T11:46:24.552Z sha 0f0790d :: needs real behavior proof before merge. :: [P1] Scope the broker secret to a dedicated Telegram proof process | [P1] Connect the Telegram label to an executable proof path | [P1] Migrate legacy Telegram proof labels
  • reviewed 2026-08-28T11:58:50.780Z sha 3701f00 :: needs real behavior proof before merge. :: [P1] Gate broker credentials on a dedicated Telegram proof invocation | [P1] Wire the new proof label to an executable E2E path

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Aug 28, 2026
@obviyus
obviyus merged commit a4592a0 into main Aug 28, 2026
16 of 17 checks passed
@obviyus
obviyus deleted the codex/telegram-userbot-proof branch August 28, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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