4-page layout (Home, Recipes, Settings, Doctor) with sidebar nav and integrated Chat panel powered by OpenClaw agent (--local). - Home: status, agents overview, recommended recipes, recent activity - Recipes: browse, preview diff, apply with params - Settings: model profiles CRUD, chat model selection, provider catalog - Doctor: diagnostics with auto-fix - Chat: OpenClaw agent integration with session persistence, agent selector, read-only advisory context injection - Progressive data loading to avoid UI blocking - API key resolution from OpenClaw agent auth-profiles - Model catalog from openclaw CLI with cache Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4.8 KiB
Openclaw-Driven Model/Channel Ops Implementation Plan
For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
For Feature
Goal: Enable model catalog and model/profile management to use openclaw CLI + caching keyed to openclaw version, add upgrade-check visibility, sync current config models into profiles, and enrich discord channel metadata.
Architecture: Introduce a small openclaw-command layer in Tauri that executes openclaw with --json options, normalizes JSON outputs, writes cache under clawpal dir keyed by openclaw CLI version, and exposes UI actions for sync/inspect.
Tech Stack: Rust (std::process + serde_json), React/Tauri IPC, OpenClaw CLI commands.
Task 1: OpenClaw command adapter + version-aware model catalog cache
Files:
src-tauri/src/commands.rssrc-tauri/src/models.rssrc-tauri/Cargo.toml(if needed)
Step 1: Implement command runner utilities
- Add small wrappers for running CLI commands (
openclaw --version,openclaw models list --all --json, with optional--provider,openclaw channels list --json --no-usage,openclaw update status --json,openclaw channels resolve ... --jsonwhen needed). - Parse and normalize JSON outputs into internal structs.
- Capture stderr for diagnostic messages.
Step 2: Add cache structs and paths
- Add catalog cache file path e.g.
model-catalog-cache.jsonunder clawpal dir. - Include fields:
cliVersion,updatedAt,providers,source,error,ttlMinutes.
Step 3: Add version-aware refresh policy
- Read current
openclaw --versionand current cache version. - If version changed, or cache stale (e.g. 12h), refresh by running
openclaw models list --all --json. - If refresh fails, fall back to config-based extraction so UI remains usable.
Step 4: Wire list_model_catalog to new pipeline
- Return CLI/ cache-normalized
ModelCatalogProvider[]. - Keep
model/probefallback from config providers in emergency path.
Task 2: OpenClaw upgrade status endpoint
Files:
src-tauri/src/commands.rssrc-tauri/src/lib.rssrc/lib/types.tssrc/lib/api.tssrc/pages/Home.tsx
Step 1: Add API result model
- Add
OpenclawUpdateChecktotypes.tswithinstallKind/channel/source/version/availabilityetc (at leastoutdated,currentVersion,latestVersion,upgradeAvailable,updateLine,checkedAt).
Step 2: Add backend command
- Add
check_openclaw_updatethat runsopenclaw update status --json. - Return normalized result and errors non-fatal to UI.
Step 3: Extend status payload
- Optionally add
openclawUpdatefield toSystemStatus, fetched insideget_system_status.
Step 4: Show on Home page
- Add “OpenClaw update” card: current vs latest, and availability warning if newer exists.
Task 3: Auto-extract existing model bindings to profiles
Files:
src-tauri/src/commands.rssrc-tauri/src/lib.rssrc/lib/types.tssrc/lib/api.tssrc/pages/Models.tsx
Step 1: Add extractor command
- New command
extract_model_profiles_from_config(dryRun: bool)that inspects/agents/*model,channels.*.model, and defaults for explicit model refs. - For each unique model ref create/refresh profiles from current config, using auth mapping heuristics:
- if model has
providerprefix andauthmap exists, pick first matchingauth.profilesfor that provider; - fallback to
default.
- if model has
- Return
created|updated|skippedstats and preview list.
Step 2: Frontend button action
- Add button
Import current model config as profilesin models page. - Add optional checkbox / confirm to enable overwrite for detected matches.
Step 3: Make bindings discover profile matches
- Since extractor writes profiles with exact
provider/model, channel/agent bindings immediately resolve to profile IDs. - Keep
find_profile_by_modellogic unchanged (already matches by exact string).
Task 4: Discord channel name enrichment via CLI resolve
Files:
src-tauri/src/commands.rssrc-tauri/src/lib.rssrc-tauri/src/types.ts(if new shape)src/pages/Channels.tsx
Step 1: Add channel-name resolver command
- Parse Discord channel IDs from channel node paths (e.g.
channels.discord.guilds.<guildId>.channels.<channelId>). - For discovered IDs, call
openclaw channels resolve <id> --channel discord --kind group --jsonand map id->name. - Return best effort, with
displayNameandnameStatus(resolved/missing).
Step 2: Cache small resolution results
- Add small cache in clawpal dir keyed by
guildId:channelIdand openclaw version. - Graceful fallback to raw ID when resolve fails.
Step 3: UI display
- Add
displayNamein channel row and keep path as stable key.
Execution flow
Use subagent-driven mode with review checkpoints because this spans Rust + React + IPC.