Repository navigation
refactor(channels): unify trusted configured-state probes - #130320
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 3:43 PM ET / 19:43 UTC. ClawSweeper reviewWhat this changesThe PR deletes a bundled-only configured-state wrapper and routes bundled and trusted installed channel setup checks through the shared package-state evaluator. Merge readinessKeep open. This is a maintainer-owned, focused refactor that is still absent from current main; source review found no patch-introduced defect, but the branch is behind main and relevant exact-head checks are incomplete. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherChannel setup detection reads package metadata together with configuration and environment values to decide whether a channel is configured. That decision feeds status and automatic enablement while preserving plugin trust and channel-owned credential rules. flowchart LR
A[Channel package metadata] --> C[Package state evaluator]
B[Configuration and environment] --> C
D[Trusted plugin policy] --> C
C --> E[Configured channel decision]
E --> F[Channel status and setup]
E --> G[Automatic enablement]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -46, Tests +35. Total -11 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep a single metadata-first evaluator after the trust boundary, while retaining explicit-config precedence, complete credential requirements, and bootstrap fallback behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor rather than a report of a standalone current failure; source and existing boundary tests define the preserved contract. Is this the best way to solve the issue? Yes. Centralizing the evaluator after the existing trust gate removes a forwarding adapter and duplicate environment policy without moving credential ownership out of channel owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c3d95c2d8071. 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
|
|
Land-ready verification for Recovery proof passed on matching dependencies: OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs src/channels/plugins/configured-state.test.ts src/channels/plugins/package-state-probes.test.ts src/channels/config-presence.test.ts src/config/channel-configured.test.ts src/config/plugin-auto-enable.core.test.ts src/config/plugin-auto-enable.channels.test.ts src/plugins/install-provenance.test.ts src/plugins/official-external-install-records.test.ts src/plugins/channel-plugin-ids.test.ts src/plugins/official-external-plugin-repair-hints.test.ts
git diff --name-only -z 4eea0d3e2711419d813fc7bff4fb13501f717e56...HEAD | xargs -0 node scripts/check-changed.mjs --All 327 tests and the full selected changed gate passed. The implementation's additional registry-install proof covered published Slack and IRC trust/partial/full/disabled configuration, not live message delivery. Independent source review and structured Codex P1 review found no blocking findings. The latest ClawSweeper rank-up asks for current-main merge validation and completed checks. Exact-head CI is now green: https://github.com/openclaw/openclaw/actions/runs/33005990770 . The current-main merge-tree check is clean; no behavior rebase is needed. Native prepare/merge will repeat the live guards. There is no standalone new bug claim or authenticated message-flow claim in this behavior-preserving refactor. |
|
Merged via squash.
|
What Problem This Solves
Channel setup detection had two implementations of the same package metadata contract: one for bundled package probes and another for trusted installed plugins. This made it easier for credential requirements and safe environment-trigger handling to diverge after the fixes in #114492.
Why This Change Was Made
Use the existing package-state evaluator for both paths after the caller has established plugin trust. Move the existing safe environment-name rule into that evaluator, and remove the configured-state forwarding module. Plugin trust, explicit disablement, complete credential requirements, and module-backed probes remain owned by their existing boundaries.
Production LOC: +31/-77 (net -46). Tests: +56/-21 (net +35). No public Plugin SDK, config, schema, or dependency changes.
User Impact
Channel setup and automatic enablement use the same rules for bundled and trusted installed packages. Incomplete credentials still do not enable a channel, and unrelated process variables such as PATH do not establish configured state.
Evidence
d97b15ae47e650817f854de5241f1cf2f1204c66.