Skip to content

refactor(approvals): simplify resolver plumbing - #120923

Merged
steipete merged 1 commit into
mainfrom
steipete/simplify-approval-resolver-plumbing
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/simplify-approval-resolver-plumbing

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Approval resolution still performed avoidable runtime plumbing: the approval client could trigger cold synchronous package/catalog filesystem discovery just to recover built-in channel labels, Telegram carried separate canonical and legacy dependency slots for the same approval resolver, and several channel lazy loaders imported broader resolver modules than they consumed. iMessage tests also retained mocks for a resolver module that the cleanup removes.

Why This Change Was Made

This follow-up uses generated channel metadata for approval labels, preserving every built-in label and the raw unknown-channel fallback without cold-path filesystem discovery. Telegram now has one local typed approval dependency resolver. The iMessage, Signal, and WhatsApp lazy loaders select only resolveApprovalOverGateway while preserving their existing clear/reset lifecycle, and the stale iMessage mocks are removed or redirected to the current seam.

The production delta is +55/-47 (net +8). That small increase establishes the generated-label ownership boundary and removes synchronous runtime discovery; tests and harnesses are +128/-94 (net +34).

User Impact

There is no user-visible behavior change. Built-in and unknown channel labels remain identical. This does not change configuration, the public Plugin SDK, protocol surfaces, docs, or approval semantics.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage channel: signal Channel integration: signal channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web size: M maintainer Maintainer-authored PR labels Aug 9, 2026
@steipete
steipete marked this pull request as ready for review August 9, 2026 05:35
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 1:43 AM ET / 05:43 UTC.

ClawSweeper review

What this changes

The PR moves approval labels to generated channel metadata, narrows four channel lazy imports to the Gateway resolver export, and unifies Telegram’s injected approval resolver seam.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No concrete correctness regression was found in the approval-path refactor. This maintainer-authored, maintainer-labeled PR remains open for normal maintainer review and exact-head CI completion.

Priority: P3
Reviewed head: 3fd23cba1d70d21568ba98bd6502ff964c860973

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a coherent owner-boundary rationale and no supported correctness finding; exact-head CI remains a merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored internal refactor, so the external-contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored internal refactor, so the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 4 items Generated-label path: The branch resolves built-in labels from generated channel IDs and aliases, while retaining the raw channel ID when no generated label exists.
Sibling loader coverage: The iMessage, Signal, and WhatsApp loaders project the same resolver export and retain their clear/reset lifecycle; the shared lazy-surface helper preserves cached import and clear behavior.
Current-main and release comparison: The PR head is not an ancestor of current main. The precursor approval and generated-metadata refactors appear after v2026.7.1-2, so this follow-up is neither already merged nor shipped.
Findings None None.
Security None None.

How this fits together

Channel plugins receive approval callbacks and forward them through a shared Gateway approval client. That client derives an operator-facing channel label and returns the approval outcome to the channel callback handler.

flowchart LR
  A[Channel approval callback] --> B[Channel plugin]
  B --> C[Lazy Gateway resolver]
  C --> D[Generated channel labels]
  C --> E[Gateway approval client]
  E --> F[Approval outcome]
  F --> G[Channel callback response]
Loading

Before merge

  • Resolve merge risk (P1) - The check rollup is incomplete and the branch is behind main; obtain a current-head green CI result before merge.
  • Complete next step (P2) - No repair job is warranted: no concrete patch defect was established, and the protected maintainer label requires explicit maintainer handling.
Agent review details

Security

None.

PR surface

Source +1, Tests +41. Total +42 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 9 56 55 +1
Tests 6 127 86 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 183 141 +42

Review metrics

Metric Value Why it matters
Production and test LOC production +55/-47 (net +8); tests +128/-94 (net +34) The small production increase establishes generated-label ownership and removes broad runtime catalog discovery; tests cover the changed resolver seams.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/channels/ids.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the generated-metadata and narrow-loader design; if the Telegram seam is revised, use overload-preserving resolver types so canonical callbacks retain a result-bearing contract without a cast.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the generated-metadata and narrow-loader design; if the Telegram seam is revised, use overload-preserving resolver types so canonical callbacks retain a result-bearing contract without a cast.

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

Not applicable: this PR is an internal refactor rather than a report of a user-visible failure.

Is this the best way to solve the issue?

Yes: generated metadata is the appropriate process-stable owner for built-in labels, and the sibling loaders retain the existing lazy-load/reset contract; the unified Telegram type is optional hardening territory, not a demonstrated current failure.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a behavior-preserving internal cleanup with no claimed user-visible change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored internal refactor, so the external-contributor real-behavior-proof gate does not apply.

Label justifications:

  • P3: This is a behavior-preserving internal cleanup with no claimed user-visible change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored internal refactor, so the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • steipete: Authored this PR and the immediately preceding generated-channel-metadata and approval-resolver refactors on current main. (role: recent area contributor; confidence: high; commits: 3fd23cba1d70, e1ec95d, c9d2ad7; files: src/channels/ids.ts, src/infra/approval-gateway-resolver.ts, extensions/telegram/src/bot-deps.ts)
  • joshavant: Recent history includes the narrowed Gateway approval runtime types and iMessage approval safety work. (role: adjacent approval-contract contributor; confidence: medium; commits: 6df2be1d068b, 6b5eaa6e; files: src/infra/approval-gateway-resolver.ts, extensions/imessage/src/approval-polls.ts)

Rank-up moves

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

  • Rebase or refresh the branch as needed and obtain green checks for the exact head before merge.

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 closed this Aug 9, 2026
@steipete steipete reopened this Aug 9, 2026
@steipete
steipete merged commit 54ae945 into main Aug 9, 2026
224 of 264 checks passed
@steipete
steipete deleted the steipete/simplify-approval-resolver-plumbing branch August 9, 2026 06:09
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: imessage Channel integration: imessage channel: signal Channel integration: signal channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant