Repository navigation
refactor: consolidate command and provider helpers - #140072
Conversation
Keep model overrides and API fallbacks in their provider owners. The shared helper has no runtime imports so eager policy loading retains its narrow dependency graph. Official plugin packages gain a host runtime dependency. Publish this with the next synchronized core and plugin release, whose canonical release sync advances pluginApi floors; do not publish these plugins alone with the existing older API floor.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 6, 2026, 7:48 AM ET / 11:48 UTC. ClawSweeper reviewWhat this changesConsolidates Telegram provider-menu rendering, update-report prompts, warning deduplication, and OpenCode reasoning-effort parsing while preserving their existing behavior. Merge readiness⛔ Blocked before merge - 1 item remains The refactor remains useful and has no identified blocking correctness defect. The earlier compatibility concern is explicitly addressed by the documented synchronized-release plan and existing release tooling. Priority: P3 Review scores
Verification
How this fits togetherThese helpers turn provider metadata and operator actions into thinking choices, Telegram keyboards, diagnostics, and update reports. The shared provider helper also becomes a runtime dependency of separately published OpenCode plugins. flowchart LR
A[Provider metadata] --> B[Shared effort parser]
B --> C[Thinking choices]
D[Provider menu requests] --> E[Telegram keyboard renderer]
F[Failed update action] --> G[Preview and confirmation]
G --> H[Report submission]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -71, Tests +83, Docs +10, Config +7, Other 0. Total +29 across 19 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the consolidated helpers and preserved behavior, shipping the OpenCode packages with the synchronized host release and its canonically advanced plugin API floors. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a preservation refactor, and source inspection found no introduced failure requiring reproduction; tests were not executed during this read-only review. Is this the best way to solve the issue? Yes: it reuses existing renderers and report functions and centralizes identical provider parsing without moving provider-specific policy; the declared release path handles the added host dependency. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1421c2164075. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit '3ed964c8ca6206d26ecc0b6567ccd1389d9948fc': (36 commits) refactor(plugins): unify install config snapshot preparation (openclaw#140081) fix: cloud provisioning stays failed after temporary storage recovers (openclaw#140021) fix(ci): preflight job outputs exceed 1 MiB on full-plan pull requests (openclaw#140018) refactor: consolidate command and provider helpers (openclaw#140072) fix(doctor): replace unavailable TUI cleanup advice (openclaw#140074) fix(plugins): avoid scoped pack failures and missing runtime entries (openclaw#140016) fix: clarify background command timeouts (openclaw#140022) fix(workboard): refresh board navigation while retaining drafts (openclaw#139952) fix: preserve newer chat drafts when rewind completes (openclaw#140066) feat(transcripts): browse and export saved meeting archives (openclaw#139875) fix(cron): complete timeout test observation phase (openclaw#140076) fix(macos): show the full automation count (openclaw#139692) fix: native worker turns fail to load WebSocket transport (openclaw#140071) fix(cli): complete quoted Bash option values (openclaw#140034) fix(chat): show command instructions while pending (openclaw#140041) refactor(cli): use canonical resume result schema (openclaw#140056) fix: restore package acceptance across install runtimes (openclaw#140062) refactor(auto-reply): keep model-selection fixtures in tests (openclaw#140069) fix(plugins): remove owned aliases before uninstalling files (openclaw#140065) fix: completed replies hang when context-engine cleanup stalls (openclaw#140023) ...
* refactor: simplify command rendering and diagnostic plumbing * refactor(providers): share exact effort profile parsing Keep model overrides and API fallbacks in their provider owners. The shared helper has no runtime imports so eager policy loading retains its narrow dependency graph. Official plugin packages gain a host runtime dependency. Publish this with the next synchronized core and plugin release, whose canonical release sync advances pluginApi floors; do not publish these plugins alone with the existing older API floor. * chore: prune removed provider assertion allowances
What Problem This Solves
Command rendering and diagnostics retained duplicate plumbing, and OpenCode Zen and Go separately interpreted the same reasoning-effort metadata. This maintenance batch consolidates those owners while preserving their existing output and operator flows.
Why This Change Was Made
Update reporting now calls the existing styled prompts and report functions directly, removing a dependency bag used only by tests. Both Telegram provider-menu hooks reuse the existing provider renderer. Warning deduplication uses its Set's insertion order instead of maintaining a second FIFO array. The two OpenCode policies share a small effort-profile helper with no runtime imports; their model overrides, provider admission, and API fallbacks stay local and unchanged.
The report flow retains sanitized preview, default-false confirmation, fresh choice after retry, and durable cross-surface receipts. Telegram keeps both public hooks, callback bytes, keyboard order and empty-list fallback. Warnings retain the 256-entry FIFO and do not refresh duplicates. Effort profiles preserve exact spelling, order, deduplication, defaults, and the distinction between absent metadata and an explicit off-only result.
Runtime TypeScript is 74 lines smaller. Registration metadata adds 12 lines, so production is net −62. Existing tests gain 83 lines and docs gain 10; two obsolete guard-inventory entries are removed; the complete 19-file diff is +29 lines. No configuration option, schema, external dependency, or third-party typed API is added.
User Impact
No intentional change to menu choices, reporting behavior, warnings, or thinking defaults. There is one new private official-plugin runtime entry, documented alongside provider policy hooks.
Separately published OpenCode plugins gain a host SDK dependency. This change must ship with the next synchronized core/plugin release, whose existing release sync advances their plugin API floors. It must not be published independently with the current older API floor. No version or compatibility-floor change is made here; release preparation and installer enforcement retain their existing ownership.
Evidence
Final source:
e9970d6416b535aca3ba9f8cab96ddcc0b1a7c1c.openclaw/ci-gate.Review Follow-through
ClawSweeper found no actionable correctness or security issue. Its remaining compatibility move is resolved by selecting the recommended synchronized core/plugin release. The new host dependency is recorded in the commit and this PR; canonical release preparation advances both plugin API floors before publication, and the installer rejects older hosts. No independent plugin publication with the current older floor is authorized or planned. The final package-level proof exercises this exact candidate host, without claiming compatibility with older releases.