eb01eb0172
Adds the operator surface for switching the controller pipeline between
the personal fork (drew/cleveragents-core) and the canonical repo
(cleveragents/cleveragents-core) via a MODE env + --prod CLI flag,
backed by safety primitives that make a wrong-mode launch loud rather
than silent.
run-controller-state-machine-pipeline.sh: --prod flag and MODE env
(primary home: .devcontainer/.env) select fork vs prod. After resolving
MODE, the launcher auto-sources the matching overlay file
(.devcontainer/.env.{fork,prod}) and asserts MODE didn't drift during
the source step. The drift assertion uses a readonly snapshot under an
obscure variable name so a stray ``MODE=fork`` in .env.prod aborts the
launch with a clear bash error rather than silently demoting the run.
CONTROLLER_RUN_DIR_ROOT now overrides the trial /tmp path so prod can
use a persistent /var/lib/cleveragents/run dir.
tools/launch_prod.sh (new): sibling to launch_fork.sh with the opposite
safety primitive — affirmative GET /repos/{owner}/{repo} that asserts
the target is non-fork, exists, isn't archived, and the bot has push.
On any failure, no env is exported. Honors HAL_* aliases for parity
with launch_fork.sh and prints a hard-to-miss PROD-MODE banner.
tools/controller/deploy/validate_db_mode.py (new): stamps a _mode_marker
table on each SQLite db (controller DB + telemetry cache) on first use,
asserts a match on every subsequent launch, and moves mismatched files
aside as <name>.<prior-mode>.bak.<ts> — never deletes. The --adopt flag
lets an operator grandfather in already-good pre-marker data without
losing history. Wired into the launcher's startup sequence before
OpenCode and the master start.
tools/_cache_path.py (new): single source of truth for the per-(owner,
repo) Forgejo cache file convention. .opencode/telemetry/server.py and
the launcher both delegate here so the dual-source-truth drift risk is
eliminated. tools/_pipeline_cache.py and tools/controller/db/models.py
documented as not owning the _mode_marker table so future migrations
leave it alone.
.opencode/telemetry/server.py: hosts the llm_activity scraper as a
background subprocess thread (60s cadence, --since-hours 1 in steady
state, full backfill on first tick). Re-homes the cost-telemetry data
path after the pr_state_warmer was retired by the controller migration
— without this the Cost tab freezes when the warmer's loop is gone.
Subprocess (not in-process) for isolation; failures swallowed.
opencode.json: local-claude provider's baseURL now reads
{env:LOCAL_PROXY_URL} instead of the literal http://127.0.0.1:3456/v1,
matching the apiKey pattern already in use.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
420 lines
16 KiB
JSON
420 lines
16 KiB
JSON
{
|
|
"$schema": "https://opencode.ai/config.json",
|
|
"permission": "allow",
|
|
"instructions": [
|
|
".opencode/instructions/*.md"
|
|
],
|
|
"mcp": {
|
|
"context7": {
|
|
"type": "local",
|
|
"command": [
|
|
"npx",
|
|
"-y",
|
|
"@upstash/context7-mcp"
|
|
],
|
|
"enabled": true
|
|
},
|
|
"sequential-thinking": {
|
|
"type": "local",
|
|
"command": [
|
|
"npx",
|
|
"@modelcontextprotocol/server-sequential-thinking"
|
|
],
|
|
"enabled": false
|
|
}
|
|
},
|
|
"provider": {
|
|
"anthropic": {
|
|
"models": {
|
|
"anthropic/claude-opus-4-6": {
|
|
"name": "Claude OPUS 4.6",
|
|
"limit": {
|
|
"context": 200000,
|
|
"output": 32768
|
|
}
|
|
},
|
|
"anthropic/claude-haiku-4-5": {
|
|
"name": "Claude Haiku 4.5",
|
|
"limit": {
|
|
"context": 200000,
|
|
"output": 32768
|
|
}
|
|
},
|
|
"anthropic/claude-sonnet-4-6": {
|
|
"name": "Claude Sonnet 4.6",
|
|
"limit": {
|
|
"context": 200000,
|
|
"output": 32768
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"local-claude": {
|
|
"npm": "@ai-sdk/anthropic",
|
|
"options": {
|
|
"baseURL": "{env:LOCAL_PROXY_URL}",
|
|
"apiKey": "{env:LOCAL_ANTHROPIC_API_KEY}"
|
|
},
|
|
"models": {
|
|
"claude-sonnet-4-6": {
|
|
"name": "Claude Sonnet 4.6 (local proxy)",
|
|
"limit": {
|
|
"context": 200000,
|
|
"output": 32768
|
|
},
|
|
"tools": true
|
|
},
|
|
"claude-opus-4-6": {
|
|
"name": "Claude Opus 4.6 (local proxy)",
|
|
"limit": {
|
|
"context": 1000000,
|
|
"output": 32768
|
|
},
|
|
"tools": true
|
|
},
|
|
"claude-haiku-4-5": {
|
|
"name": "Claude Haiku 4.5 (local proxy)",
|
|
"limit": {
|
|
"context": 200000,
|
|
"output": 32768
|
|
},
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://ke5ntcikhnj2clcp.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-6-35B-A3B-GGUF-BF16": {
|
|
"name": "Qwen 3.6 35b A3B GGUF BF16 (Thinking)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-2": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://bqdgwv2uzjgianhe.us-east-2.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"MiniMax-M2-7-GGUF-BF16": {
|
|
"name": "MiniMax M2.7 GGUF BF16 (Thinking)",
|
|
"limit": {
|
|
"context": 196608,
|
|
"output": 65536
|
|
},
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-3": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://jve0bsgx6csdzln9.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Devstral-Small-2-24B-Instruct-GGUF": {
|
|
"name": "Devstral Small 2 24B GGUF (Instruct)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-4": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://ntgtpdbn2vuag4yb.us-east-2.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Kimi-K2-6-GGUF-Q2-K-XL": {
|
|
"name": "Kimi K2.6 GGUF Q2_K_XL (Thinking)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-5": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://fhe4kwehnm1rb275.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-Coder-Next-GGUF-BF16": {
|
|
"name": "Qwen3 Coder Next GGUF BF16",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-6": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://f0oelboag4bzw1zp.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Nemotron-3-Nano-30B-GGUF-Q8-K-XL": {
|
|
"name": "Nemotron 3 Nano 30B GGUF Q8_K_XL (Thinking)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-7": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://dfwwzwtekzhnh4fl.us-east-2.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"DavidAU/Qwen3.6-40B-Claude-4.6-Opus-Deckard-Heretic-Uncensored-Thinking": {
|
|
"name": "Qwen 3.6 40B Uncensored BF16 (Thinking)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-8": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://ki19d58snp1d3qa4.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-Coder-Next-GGUF-Q4-0": {
|
|
"name": "Qwen3 Coder Next GGUF Q4_0",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-9": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://m56026p5kxvout0d.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-6-35B-A3B-GGUF-MXFP4-MOE": {
|
|
"name": "Qwen 3.6 35b A3B GGUF MXFP4_MOE (Thinking)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-10": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://dirv1cnem5wqzoax.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-235B-A22B-INST-GGUF-Q8-0": {
|
|
"name": "Qwen3 235b A22B GGUF Q8_0 (Instruct)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-11": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://hueiyrdbly1ff4oo.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-235B-A22B-INST-GGUF-UD-Q2-K-XL": {
|
|
"name": "Qwen3 235b A22B GGUF UD-Q2_K_XL (Instruct)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-12": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://atocunu78hjdnu3f.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-30B-A3B-INST-GGUF-UD-Q8-K-XL": {
|
|
"name": "Qwen3 30b A3B GGUF UD-Q8_K_XL (Instruct)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-13": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://dpe3orf5en4581im.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-30B-A3B-INST-GGUF-UD-Q5-K-XL": {
|
|
"name": "Qwen3 30b A3B GGUF UD-Q5_K_XL (Instruct)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-14": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://jamyigykfzm39bcu.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"MiniMax-M2-7-GGUF-UD-Q4-K-XL": {
|
|
"name": "MiniMax M2.7 GGUF UD-Q4_K_XL (Thinking)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-15": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://n4u4h8h0fgintms4.us-east-1.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-6-35B-A3B-GGUF-UD-Q3-K-XL": {
|
|
"name": "Qwen 3.6 35b A3B GGUF UD-Q3_K_XL (Thinking)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"CleverThis-16": {
|
|
"npm": "@ai-sdk/openai-compatible",
|
|
"options": {
|
|
"baseURL": "https://kcgeda25msp4dkwm.us-east-2.aws.endpoints.huggingface.cloud/v1",
|
|
"apiKey": "{env:HF_TOKEN}",
|
|
"headers": {
|
|
"X-HF-Bill-To": "CleverThis",
|
|
"Authorization": "Bearer {env:HF_TOKEN}"
|
|
}
|
|
},
|
|
"models": {
|
|
"Qwen3-code-480B-A35B-INST-GGUF-1M-UD-Q3-K-XL": {
|
|
"name": "Qwen3 Code 480b A35B GGUF UD-Q3_K_XL (Instruct, 1M Context)",
|
|
"tools": true
|
|
}
|
|
}
|
|
},
|
|
"openai": {
|
|
"models": {
|
|
"gpt-5-codex": {
|
|
"name": "GPT-5 Codex"
|
|
},
|
|
"gpt-5-mini": {
|
|
"name": "GPT-5 Mini"
|
|
},
|
|
"gpt-5-nano": {
|
|
"name": "GPT-5 Nano"
|
|
},
|
|
"o4-mini": {
|
|
"name": "o4-mini"
|
|
}
|
|
}
|
|
},
|
|
"google": {
|
|
"models": {
|
|
"gemini-2.5-pro": {
|
|
"name": "Gemini 2.5 Pro"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"agent": {
|
|
"async-agent-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"auto-agents": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"conflict-resolver-worker": { "model": "{file:./.opencode/models/conflict-resolver-worker.txt}" },
|
|
"estimator-implementation": { "model": "{file:./.opencode/models/estimator-implementation.txt}" },
|
|
"git-checkout-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-cleanup-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-clone-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-commit-and-push-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-commit-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-create-commit-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-fetch-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-force-push-with-lease-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-isolator-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-push-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-rebase-and-push-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-rebase-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"git-stage-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"implementation-worker": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"pr-merge-supervisor": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"pr-merge-worker": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"pr-review-worker": { "model": "{file:./.opencode/models/pr-review-worker.txt}" },
|
|
"pr-review-worker-dispute": { "model": "{file:./.opencode/models/pr-review-worker-dispute.txt}" },
|
|
"session-health-full-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"session-health-quick-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"session-health-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"supervisor": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"work-group-util": { "model": "{file:./.opencode/models/default.txt}" },
|
|
"task-implementor-tier-min": { "model": "local-claude/claude-haiku-4-5" },
|
|
"task-implementor-tier-0": { "model": "local-claude/claude-haiku-4-5" },
|
|
"task-implementor-tier-1": { "model": "local-claude/claude-sonnet-4-6" },
|
|
"task-implementor-tier-2": { "model": "local-claude/claude-opus-4-6" },
|
|
"ca-test-infra-improver": { "model": "{file:./.opencode/models/ca-test-infra-improver.txt}" }
|
|
}
|
|
}
|