From 405433bb7f3e28aad409e9f00ee5cc594149ade8 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 24 Feb 2026 09:25:40 -0600 Subject: [PATCH] Signed-off-by: Matt Bruce --- openclaw-setup-max/PRD.md | 3 +- openclaw-setup-max/README.md | 15 ++- .../config/model-budget-guard.config.json | 5 +- .../config/model-profiles.config.json | 2 +- .../docs/operations/MODEL_SWITCHING.md | 2 +- openclaw-setup-max/scripts/research.sh | 108 ++++++++++++++++++ 6 files changed, 127 insertions(+), 8 deletions(-) create mode 100755 openclaw-setup-max/scripts/research.sh diff --git a/openclaw-setup-max/PRD.md b/openclaw-setup-max/PRD.md index f50076f..b54b803 100644 --- a/openclaw-setup-max/PRD.md +++ b/openclaw-setup-max/PRD.md @@ -154,7 +154,7 @@ Outputs: ## 10) Acceptance Criteria - AC-1: Running `bash ./scripts/model_profile_switch.sh free` changes default to `ollama/qwen3:14b`. -- AC-2: Running `bash ./scripts/model_profile_switch.sh paid` restores default to `moonshot/kimi-k2.5`. +- AC-2: Running `bash ./scripts/model_profile_switch.sh paid` restores default to `openrouter/moonshotai/kimi-k2.5`. - AC-3: With schedule enabled (`21`/`7`), profile changes correctly by local time window. - AC-4: If operator manually drifts model during scheduled window, schedule guard re-aligns on next run. - AC-5: Budget guard warns and reverts when high model remains active beyond thresholds. @@ -186,4 +186,3 @@ Outputs: - Per-channel session key mapping (Telegram/Discord-specific switching). - Daily spend estimator from model usage telemetry. - Optional provider locking profile policies. - diff --git a/openclaw-setup-max/README.md b/openclaw-setup-max/README.md index 2d23a07..55ebad5 100644 --- a/openclaw-setup-max/README.md +++ b/openclaw-setup-max/README.md @@ -1,7 +1,7 @@ # OpenClaw Setup Max (Paid + Free Model Switching) This workspace runs OpenClaw with: -- A paid high-quality model profile (`moonshot/kimi-k2.5`) +- A paid high-quality model profile (`openrouter/moonshotai/kimi-k2.5`) - A free local profile (Ollama-only) - One-command live switching - Optional automatic day/night switching (example: free from 9pm-7am) @@ -27,7 +27,7 @@ Everything else is grouped by function: ## 1) What You Get - `paid` profile: - - Primary: `moonshot/kimi-k2.5` + - Primary: `openrouter/moonshotai/kimi-k2.5` - Fallbacks: `ollama/qwen3:14b`, `ollama/llama3.2:3b` - `free` profile: - Primary: `ollama/qwen3:14b` @@ -102,6 +102,17 @@ Check current model state: bash ./scripts/model_profile_switch.sh status ``` +Run a web research task from terminal: + +```bash +./scripts/research.sh latest swiftui observation patterns +``` + +Optional flags: +- `--sources ` minimum source count (default `3`) +- `--thinking ` sets OpenClaw thinking level +- `--deliver` sends the final response back to the current channel + ## 5) How Live Switching Works When you run: diff --git a/openclaw-setup-max/config/model-budget-guard.config.json b/openclaw-setup-max/config/model-budget-guard.config.json index 063501c..a7a00e2 100644 --- a/openclaw-setup-max/config/model-budget-guard.config.json +++ b/openclaw-setup-max/config/model-budget-guard.config.json @@ -3,8 +3,9 @@ "sessionKey": "agent:main:main", "lowModel": "ollama/qwen3:14b", "highModels": [ - "moonshot/kimi-k2.5", - "xai/grok-4-fast" + "openrouter/moonshotai/kimi-k2.5", + "xai/grok-4-fast", + "xai/grok-code-fast-1" ], "warnAfterMinutes": 2, "revertAfterMinutes": 45, diff --git a/openclaw-setup-max/config/model-profiles.config.json b/openclaw-setup-max/config/model-profiles.config.json index 1d836c8..c1ad785 100644 --- a/openclaw-setup-max/config/model-profiles.config.json +++ b/openclaw-setup-max/config/model-profiles.config.json @@ -2,7 +2,7 @@ "profiles": { "paid": { "description": "High-quality paid model for deep work", - "primary": "moonshot/kimi-k2.5", + "primary": "openrouter/moonshotai/kimi-k2.5", "fallbacks": [ "ollama/qwen3:14b", "ollama/llama3.2:3b" diff --git a/openclaw-setup-max/docs/operations/MODEL_SWITCHING.md b/openclaw-setup-max/docs/operations/MODEL_SWITCHING.md index 300bb3b..ab13faa 100644 --- a/openclaw-setup-max/docs/operations/MODEL_SWITCHING.md +++ b/openclaw-setup-max/docs/operations/MODEL_SWITCHING.md @@ -2,7 +2,7 @@ This setup adds two model profiles: -- `paid` -> `moonshot/kimi-k2.5` with local Ollama fallbacks +- `paid` -> `openrouter/moonshotai/kimi-k2.5` with local Ollama fallbacks - `free` -> local Ollama-only stack ## On-demand switch (immediate) diff --git a/openclaw-setup-max/scripts/research.sh b/openclaw-setup-max/scripts/research.sh new file mode 100755 index 0000000..24fc57f --- /dev/null +++ b/openclaw-setup-max/scripts/research.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'USAGE' +Usage: + research + research --sources + research --thinking + research --deliver + +Examples: + research swiftui state management in 2026 + research --sources 5 best local llm coding setups + research --thinking high ai coding agents comparison +USAGE +} + +source_count="3" +thinking_level="" +deliver="false" +agent_id="${RESEARCH_AGENT_ID:-main}" + +while (( "$#" )); do + case "$1" in + --sources) + shift + if [[ $# -eq 0 ]]; then + echo "[research] --sources requires a number" >&2 + usage + exit 1 + fi + source_count="$1" + ;; + --thinking) + shift + if [[ $# -eq 0 ]]; then + echo "[research] --thinking requires a level" >&2 + usage + exit 1 + fi + thinking_level="$1" + ;; + --deliver) + deliver="true" + ;; + -h|--help) + usage + exit 0 + ;; + --) + shift + break + ;; + -*) + echo "[research] unknown argument: $1" >&2 + usage + exit 1 + ;; + *) + break + ;; + esac + shift +done + +if [[ $# -eq 0 ]]; then + echo "[research] topic is required" >&2 + usage + exit 1 +fi + +if ! [[ "$source_count" =~ ^[0-9]+$ ]] || [[ "$source_count" -lt 1 ]]; then + echo "[research] --sources must be a positive integer" >&2 + exit 1 +fi + +if ! command -v openclaw >/dev/null 2>&1; then + echo "[research] openclaw CLI is required" >&2 + exit 1 +fi + +topic="$*" +message=$( + cat <