Repository navigation
refactor(approvals): simplify resolver plumbing - #120923
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 1:43 AM ET / 05:43 UTC. ClawSweeper reviewWhat this changesThe 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 readinessNo 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 Review scores
Verification
How this fits togetherChannel 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +41. Total +42 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
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
resolveApprovalOverGatewaywhile 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
tbx_01kzjdw8n0e8xdnghrge0d4mnm: https://github.com/openclaw/openclaw/actions/runs/31295508549git diff --checkpassed.