tachibot-mcp 2.27.1 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/README.md +23 -7
- package/dist/src/config/model-constants.js +58 -29
- package/dist/src/config/timeout-config.js +2 -1
- package/dist/src/modes/challenger.js +2 -2
- package/dist/src/modes/scout.js +3 -3
- package/dist/src/optimization/model-router.js +34 -17
- package/dist/src/profiles/balanced.js +2 -1
- package/dist/src/profiles/code_focus.js +2 -1
- package/dist/src/profiles/full.js +2 -1
- package/dist/src/profiles/heavy_coding.js +2 -1
- package/dist/src/profiles/minimal.js +2 -1
- package/dist/src/profiles/research_power.js +2 -1
- package/dist/src/tools/diff-review-tool.js +14 -6
- package/dist/src/tools/gemini-tools.js +104 -46
- package/dist/src/tools/grok-enhanced.js +5 -3
- package/dist/src/tools/grok-search-lite-tool.js +21 -7
- package/dist/src/tools/grok-tools.js +9 -4
- package/dist/src/tools/jury-tool.js +74 -30
- package/dist/src/tools/openai-tools.js +65 -24
- package/dist/src/tools/openrouter-tools.js +21 -10
- package/dist/src/tools/plan-critique-tool.js +12 -5
- package/dist/src/tools/planner-tools.js +5 -2
- package/dist/src/tools/workflow-runner.js +1 -1
- package/dist/src/utils/ansi-styles.js +20 -16
- package/dist/src/utils/judge-constants.js +83 -0
- package/dist/src/utils/judge-runner.js +58 -0
- package/dist/src/utils/provider-failure.js +18 -0
- package/dist/src/utils/provider-router.js +4 -4
- package/dist/src/utils/smart-api-client.js +3 -3
- package/dist/src/workflows/custom-workflows.js +8 -2
- package/dist/src/workflows/tool-mapper.js +34 -12
- package/docs/TOOLS_REFERENCE.md +1 -1
- package/docs/TOOL_PARAMETERS.md +1 -1
- package/docs/superpowers/plans/2026-08-12-kitchen-architecture.md +1600 -0
- package/docs/superpowers/plans/2026-08-12-openrouter-spec-table.md +1201 -0
- package/docs/superpowers/plans/2026-08-12-prompt-approach-repair.md +2059 -0
- package/docs/superpowers/plans/2026-08-12-provider-catalogs.md +1519 -0
- package/docs/superpowers/plans/2026-08-14-mcp-compliance-and-tool-surface.md +3035 -0
- package/package.json +1 -1
- package/profiles/balanced.json +2 -1
- package/profiles/code_focus.json +2 -1
- package/profiles/full.json +2 -1
- package/profiles/heavy_coding.json +2 -1
- package/profiles/minimal.json +2 -1
- package/profiles/research_power.json +2 -1
- package/skills/landing/SKILL.md +110 -0
- package/skills/release/SKILL.md +135 -0
- package/smithery.yaml +1 -1
- package/tools.config.json +65 -17
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,71 @@ All notable changes to TachiBot MCP will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.30.0] - 2026-08-14
|
|
9
|
+
|
|
10
|
+
Ten defects found by an MCP-compliance audit. Every one was verified against source or the live xAI API before being fixed; each carries a regression test.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **`grok_search` was not searching.** It ran on `grok-4.5`, which never invokes the `web_search` tool on xAI's Agent Tools API — so it answered from training data while rendering a source footer and a "Search used up to N sources" line computed locally from `max_search_results`, not from actual usage. Probed 2026-08-14: asked the date, `grok-4.5` returned "October 10, 2025" with zero `web_search_call` entries; `grok-4.6` returned the correct date with two search calls and a citation. Repointed to `grok-4.6` (added to `GROK_MODELS`/`GrokModel`; same $2/$6 and 500K context as 4.5). The new test asserts *grounding* — presence of a `web_search_call` and ≥1 annotation — never the answer text, because a plausible ungrounded answer is exactly what hid this.
|
|
14
|
+
- **13 `console.log` calls corrupted the JSON-RPC stream.** stdout is the protocol channel on a stdio-transport MCP server. Sites in `provider-router.ts` (fired on every routed provider call), `smart-api-client.ts`, `scout.ts`, `challenger.ts`, `custom-workflows.ts` now use `console.error`. Guarded by a test that also rejects `console.info`, `console.debug` and `process.stdout.write`.
|
|
15
|
+
- **`create_workflow` silently destroyed user files.** `saveWorkflow()` checked `existsSync` on the *directory* and then wrote the *file* unguarded, so a name collision overwrote existing YAML with no warning. Now refuses unless `overwrite: true` is passed, and the success message reports the real `.tachibot/workflows/` path instead of `.tachi/workflows/`.
|
|
16
|
+
- **Eight prompt maps injected the literal string "undefined".** The `||` fallback sat *inside* the index (`approachPrompts[args.approach || 'analytical']`), so it only rescued an empty value — any unknown one still resolved to `undefined` and landed in the system prompt. Fixed in `grok_reason`, `grok_code`, `kimi_thinking`, `qwen_reason`, `deepseek_reason`, `glm_reason`, `stepfun_reason`, `ernie_reason`. Same class as 2.28.x's OpenAI fix.
|
|
17
|
+
- **`tool-mapper` ran the wrong model.** Its `qwen_algo` case called `QWQ_32B` with a generic prompt instead of Qwen3.8-Max with the algorithm-engineer protocol, and `qwq_reason` lost its 4-persona deliberation entirely — so a workflow step got a materially different tool than the MCP tool of the same name. Both now delegate to the real tool objects.
|
|
18
|
+
- **`planner_maker` emitted an invalid tool call.** Its `qwen_coder` step sent `{task, code, requirements}`, but that schema has no `requirements`, requires `query`, and `requirements` is not an input alias — so every agent execution of that step failed Zod validation.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Test suite 130 → 158 (157 passing, 1 opt-in live probe). The live grok grounding probe now requires `RUN_LIVE_TESTS=1` in addition to a key, so an ordinary `npm test` no longer fires a billed API call.
|
|
22
|
+
|
|
23
|
+
### Notes
|
|
24
|
+
- Golden snapshot unchanged: no tool name, description, or input schema moved. This release is behavior-only.
|
|
25
|
+
- `grok-4.6` is the current latest Grok, verified against `GET /v1/models`. There is no `grok-4.7` or `grok-5`.
|
|
26
|
+
|
|
27
|
+
## [2.29.0] - 2026-08-12
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- **Failed jurors were synthesized as real opinions.** Every provider helper catches internally and RETURNS a marker string (`[Grok error: ...]`, `[OpenRouter timeout: ...]`) rather than throwing, so `jury`'s drop filter only ever caught typed throws from `callLocal`. A quota-limited juror reached the judge as a considered perspective. New `utils/provider-failure.ts` detects the markers; verified against all nine real provider error strings with no false positives on realistic answers.
|
|
31
|
+
- **The judge was told the wrong juror count.** The prompt interpolated `validJurors.length` while showing `liveJurors`, presenting a short-handed panel as full and miscalibrating every consensus claim. Counts now come from what the judge is actually shown, and dropped jurors are declared to it.
|
|
32
|
+
- **`grok_search_lite` advertised a model it wasn't using.** `grok-4-1-fast-non-reasoning` was retired by xAI, and the retirement is invisible: the API returns HTTP 200 and silently serves `grok-4.3`, disclosing the swap only in `response.model` (which the codebase discards). Nothing threw, so no fallback could fire. The tool billed $1.25/$2.50 while claiming $0.20/$0.50 and "~10x cheaper" in three user-visible places. Now points at `grok-4.3` explicitly with corrected claims — zero behaviour change, since 4.3 was already what ran.
|
|
33
|
+
- **`continue_focus` was unprofileable.** Emitted by the server but absent from `ToolsConfig` and all six profiles, so it could not be disabled by any profile including `minimal`, and was invisible to every count. Registered in all six (behaviour-preserving); `full` now reports 66, matching the emitted contract exactly.
|
|
34
|
+
- **The literal string `"undefined"` could be injected into reasoning prompts.** Five sites indexed a closed prompt map with the fallback inside the brackets (`modePrompts[x || 'default']`), so any value not in the map missed the lookup silently. Only `openai_reason` was reachable — its `mode` is a free string per the tool-param rule, which is precisely what removed the enum guard protecting the others.
|
|
35
|
+
- **`gemini-tools.ts` depended on import order for its API key.** It read `process.env` at module scope under a comment claiming "dotenv is loaded in server.ts before any imports" — false: `server.ts` is a 12-line dispatcher with no dotenv call, and `server-main.ts`'s `override: true` runs in its module body, after the whole static graph. It worked only because `grok-tools.js` calls `config()` eleven lines earlier in `registry.ts`. Now self-sufficient.
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- **Judge fallback chain (`utils/judge-runner.ts`).** A single Gemini failure used to destroy an entire panel *after* every juror had run and billed. Judges now escalate: retry with backoff (honouring Google's `RetryInfo.retryDelay`) → degrade Pro→Flash → escalate to `gpt-5.6-sol` → return raw unsynthesized perspectives with an explicit warning. Wired into `jury`, `diff_review`, and `plan_critique`. Verified live against a real quota outage: Pro 429 ×3 → Flash 429 → sol answered in 7.5s.
|
|
39
|
+
- **`callGemini` retains the API error body**, which it previously discarded in favour of `statusText`. Google puts the useful part there — which quota was hit, and a `retryDelay` when the limit is transient rather than a plan cap.
|
|
40
|
+
- **`max` reasoning effort** for OpenAI. `gpt-5.6` accepts `none|low|medium|high|xhigh|max`, but `OPENAI_REASONING` stopped at `xhigh` and the zod enum rejected `max`, so nothing could request the top tier. The 180s timeout branch now covers it.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
- **Judge prompts rewritten** (`utils/judge-constants.ts`, shared by `jury` and `gemini_judge`, which carried drifting copies). Jurors are anonymized so the judge weighs reasoning rather than brand; the "You are Gemini 3 Pro" persona is gone (stale, and an invitation to self-preference bias); six stacked reasoning frameworks are replaced by decomposition into sub-claims tagged AGREED/CONTESTED/UNVERIFIED plus one adversarial pass; the impossible self-consistency instruction is removed (it requires sampling repeatedly, which one call cannot do); and the judge is told it cannot verify factual claims rather than being graded on "accuracy" it has no means to assess.
|
|
44
|
+
- **OpenAI pricing corrected** for the Jul 30 2026 cut: terra $2.50/$15 → $2/$12, luna $1/$6 → $0.20/$1.20. `MODEL_COSTS` had luna 5x over reality, skewing cost-aware routing.
|
|
45
|
+
- **`optimization/model-router.ts` refreshed.** Its `ModelTier` enum was routing live workflow traffic to Mar-2026 models (`gpt-5.4`, `gpt-5.4-pro`, `gemini-3-flash-preview`), and no current model appeared in its cost table, so every one fell through to a flat $0.001 estimate.
|
|
46
|
+
- **`openai_reason` runs `xhigh`** (was `high`). `max` is deliberately not the default — OpenAI recommends reserving it for hardest-case work.
|
|
47
|
+
- **`openai_search` moves to `gpt-5.6-terra`** (was `sol`). Web search bills a flat $10/1k calls regardless of model, so the model is the only cost lever, and it was set to the most expensive option. All 5.6 tiers support `web_search` identically.
|
|
48
|
+
|
|
49
|
+
### Verified, not changed
|
|
50
|
+
- **Gemini 3.1 Pro is still the newest Pro model** — no 3.5 Pro or 4 has shipped. Confirmed against Google's live docs by two independent sources plus a direct `models.list` probe (HTTP 200, exact id match). Grok 4.5 likewise remains flagship. No Codex-specific OpenAI model exists; the `CODEX*` constants are legacy aliases.
|
|
51
|
+
|
|
52
|
+
## [2.28.0] - 2026-08-03
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
- **Qwen3.8 Max** (`qwen/qwen3.8-max`) registered in `OpenRouterModel` and `QWEN_MODELS`. Alibaba's flagship 3.8-series model, general-availability on OpenRouter as of today (Aug 3, 2026). 1M context (up from the 262K of the model it replaces), multimodal input (text+image+video), 131K max completion, $2/$6 per M with cache reads at $0.25/M. It is the **first Qwen model exposing `reasoning_effort`**.
|
|
56
|
+
- **`reasoning_effort` option on `callOpenRouter`** (`"low" | "medium" | "high"`) — forwarded to the OpenRouter request body only when set. OpenRouter drops the parameter for models that don't list it in `supported_parameters`, so the quota-fallback chain stays safe.
|
|
57
|
+
- **`qwen/qwen3.7-max`** registered as the intermediate fallback tier.
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
- **`qwen_algo` and `qwen_reason` move to Qwen3.8 Max** (from `qwen/qwen3-235b-a22b-thinking-2507`). Verified live against a range-query algorithm problem (offline BIT / persistent segment tree): 3.8 Max produced the most complete answer of the five Qwen candidates tested — the only one to flag both the offline-vs-online tradeoff and the strict-inequality-with-duplicates edge case. The outgoing 235B Thinking model was correct but shallow; `qwen3.7-max` cost 1.6x for twice the wall time. `qwen/qwen3-max-thinking` was rejected outright: it returns 0 reasoning tokens, so its fast/cheap result is not a thinking pass.
|
|
61
|
+
- **`reasoning_effort` is pinned to `"medium"` on every Qwen3.8 call site — never left unset.** Measured on one `qwen_algo` call with the full tool prompt: default effort 302s / 14991 completion tokens / $0.091, `high` 353s / 17521 tokens / $0.106, `medium` 48s / $0.018, `low` 38s / $0.014. On the quality probe, `medium` (18s, $0.006) hit both depth markers that `high` did, while `low` dropped the online-alternative discussion. For reference the outgoing 235B model took 169s and $0.036 on the same prompt for a *shorter* answer — so `medium` is faster, cheaper, and deeper than what it replaces, while the default would have been a 6x latency and 2.5x cost regression.
|
|
62
|
+
- **Output budget for both tools raised 8000 → 12000 tokens** — headroom for the visible answer. Note that reasoning tokens are billed as completion tokens but are *not* charged against `max_tokens` by this provider (a 12000-cap call returned 17521 completion tokens).
|
|
63
|
+
- **`qwen_reason` juror** (`jury-tool.ts`) also moves to Qwen3.8 Max, likewise pinned to `"medium"` — the panel waits on its slowest juror, and default effort would have parked it at ~5 minutes.
|
|
64
|
+
- **`MODEL_FALLBACKS`**: `qwen3.8-max` → `qwen3.7-max` → `qwen3-235b-a22b-thinking-2507`.
|
|
65
|
+
- **`getOpenRouterModelTimeout()`** now routes `qwen3.8` and `qwen3.7-max` to the 600s extended bucket — neither ID contains `thinking`/`reasoning`, so they would otherwise have inherited the 180s default despite being reasoning models.
|
|
66
|
+
- **`TOOL_DEFAULTS.qwen_algo` / `.qwen_reason`** and `CURRENT_MODELS.openrouter.qwen_reason` updated to match the wired values.
|
|
67
|
+
- Tool description and system prompt for `qwen_reason` renamed from "Qwen3-Max-Thinking (>1T params, 98% HMMT)" to Qwen3.8 Max; golden tool-contract snapshot regenerated (this description is the only contract change — tool count stays 65).
|
|
68
|
+
|
|
69
|
+
### Unchanged
|
|
70
|
+
- **`qwen_coder`, `qwen_competitive`, and `testgen` stay on `qwen3-coder-next`** — it is coding-specialized and ~16x cheaper ($0.12/$0.80 vs $2/$6). Qwen3.8 Max is the reasoning tier, not the codegen tier.
|
|
71
|
+
- `deepseek_algo` (DeepSeek V4 Pro) remains the primary recommendation for algorithmic review; `qwen_algo` is now a stronger runner-up.
|
|
72
|
+
|
|
8
73
|
## [2.27.1] - 2026-07-26
|
|
9
74
|
|
|
10
75
|
### Changed
|
package/README.md
CHANGED
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
### Multi-Model AI Orchestration Platform
|
|
6
6
|
|
|
7
|
-
[](https://www.npmjs.com/package/tachibot-mcp)
|
|
8
|
+
[](#-tool-ecosystem-66-tools)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
[](https://nodejs.org)
|
|
11
11
|
[](https://modelcontextprotocol.io)
|
|
12
12
|
|
|
13
|
-
**
|
|
13
|
+
**66 AI tools. 12 providers. One protocol.**
|
|
14
14
|
|
|
15
|
-
Orchestrate Perplexity, Grok 4.
|
|
15
|
+
Orchestrate Perplexity, Grok 4.6, GPT-5.6, Gemini, Qwen, Kimi K3, and MiniMax M3
|
|
16
16
|
from Claude Code, Claude Desktop, Cursor, or any MCP client.
|
|
17
17
|
|
|
18
|
-
[Get Started](#-quick-start) · [View Tools](#-tool-ecosystem-
|
|
18
|
+
[Get Started](#-quick-start) · [View Tools](#-tool-ecosystem-66-tools) · [Documentation](https://tachibot.com/docs)
|
|
19
19
|
|
|
20
20
|
<br>
|
|
21
21
|
|
|
@@ -30,6 +30,22 @@ from Claude Code, Claude Desktop, Cursor, or any MCP client.
|
|
|
30
30
|
|
|
31
31
|
## What's New
|
|
32
32
|
|
|
33
|
+
### v2.30.0
|
|
34
|
+
- **`grok_search` was not searching.** It ran on `grok-4.5`, which never invokes the `web_search` tool on xAI's Agent Tools API — so it answered from training data while still rendering a source footer and a "Search used up to N sources" cost line computed locally from `max_search_results`, not from real usage. Probed Aug 14: asked today's date, `grok-4.5` replied *"October 10, 2025"* with zero `web_search_call` entries; **`grok-4.6` replied correctly with two search calls and a citation.** `grok_search` now runs `grok-4.6` (same $2/$6 and 500K context as 4.5). The regression test asserts *grounding* — a `web_search_call` and ≥1 annotation — never the answer text, because a plausible ungrounded answer is precisely what hid this.
|
|
35
|
+
- **Correction to the v2.27.0 note below:** `grok_search_lite` never ran on `grok-4-1-fast` at $0.20/$0.50. xAI retired that id and silently served `grok-4.3` — HTTP 200, the swap disclosed only in the response body's `model` field, so nothing threw and no fallback fired. The advertised "~10x cheaper" was really ~1.6x, and `grok-4.3` does not invoke web search either.
|
|
36
|
+
- **13 `console.log` calls were corrupting the MCP protocol stream.** stdout is the JSON-RPC channel on a stdio server; diagnostics now go to stderr, guarded by a test that also rejects `console.info`, `console.debug` and `process.stdout.write`.
|
|
37
|
+
- **`create_workflow` silently destroyed existing workflow files** — the existence check guarded the *directory*, not the *file*. It now refuses to clobber unless `overwrite: true`, and reports the real `.tachibot/workflows/` path instead of `.tachi/workflows/`.
|
|
38
|
+
- **Eight prompt maps injected the literal string `"undefined"`** into system prompts for any unrecognised `approach`/`task`, because the `||` fallback sat *inside* the index. Fixed across `grok_reason`, `grok_code`, `kimi_thinking`, `qwen_reason`, `deepseek_reason`, `glm_reason`, `stepfun_reason`, `ernie_reason`.
|
|
39
|
+
- **Workflow steps ran the wrong model** — the `qwen_algo` step called QwQ-32B with a generic prompt instead of Qwen3.8-Max, and `qwq_reason` lost its 4-persona deliberation entirely. Both now delegate to the real tools. Separately, `planner_maker`'s `qwen_coder` step sent a parameter the schema rejects, so every execution of it failed validation.
|
|
40
|
+
- Test suite **130 → 158**. The live search probe is now opt-in behind `RUN_LIVE_TESTS=1`, so an ordinary `npm test` no longer makes a billed API call.
|
|
41
|
+
|
|
42
|
+
### v2.28.0
|
|
43
|
+
- **Qwen3.8 Max** (Aug 3, `qwen/qwen3.8-max`) — Alibaba's new flagship, GA the same day, now powers `qwen_algo`, `qwen_reason`, and the `qwen_reason` juror. **1M context (up from 262K)**, multimodal (text+image+video in), and the first Qwen exposing **configurable reasoning effort**. $2/$6 per M.
|
|
44
|
+
- **Measured on a range-query algorithm problem**, 3.8 Max was the only one of five Qwen candidates to surface both the offline-vs-online tradeoff and the strict-inequality-with-duplicates edge case. The outgoing `qwen3-235b-a22b-thinking-2507` was correct but shallow; `qwen3.7-max` cost 1.6x for twice the wall time; `qwen3-max-thinking` was rejected outright — it returns zero reasoning tokens.
|
|
45
|
+
- **Effort is pinned to `medium`, deliberately.** This model's *default* effort behaves like `high`: 302s and $0.09 on a single `qwen_algo` call. At `medium` the same call answers at equal depth in 18–48s for $0.006–0.018 — cheaper *and* 3.5x faster than the model it replaces, which took 169s and $0.036 for a shorter answer. `low` starts dropping alternatives and is not used.
|
|
46
|
+
- **`reasoning_effort` pass-through for OpenRouter** — `callOpenRouter` now forwards the parameter; OpenRouter drops it for models that don't list it, so the quota fallback chain (3.8 Max → 3.7 Max → 235B Thinking) stays safe. Qwen3.8/3.7-Max also join the 600s extended-timeout bucket.
|
|
47
|
+
- **`qwen_coder`, `qwen_competitive`, `testgen` stay on Qwen3-Coder-Next** — it is coding-specialized and ~16x cheaper ($0.12/$0.80); 3.8 Max is the reasoning tier, not the codegen tier.
|
|
48
|
+
|
|
33
49
|
### v2.27.1
|
|
34
50
|
- **Kimi K3** (Jul 16, `moonshotai/kimi-k3`) now powers every Kimi tool, the `kimi` juror, and the Kimi seat on `diff_review`. 2.8T open-weight MoE — the largest open model shipped — with a **1M context (up from 262K)**, native multimodal input, and long-horizon agentic coding that beats Opus 4.8 and GPT-5.5 on coding/agent benchmarks. Note the price: **$3/$15 per M, 4x K2.7-Code** — K2.7-Code stays as the automatic fallback (K3 → K2.7-Code → K2.6).
|
|
35
51
|
- **Gemini 3.6 Flash** (Jul 21, `gemini-3.6-flash`) is the new search/workhorse tier behind `gemini_search` — 1M context at **$1.50/$7.50, down from $9 output**, and ~17% fewer output tokens than 3.5 Flash. Flash-Lite moves to `gemini-3.5-flash-lite` ($0.30/$2.50).
|
|
@@ -57,7 +73,7 @@ from Claude Code, Claude Desktop, Cursor, or any MCP client.
|
|
|
57
73
|
- **One-click Claude Desktop install** — download the `.mcpb` from the latest release and double-click. No JSON editing.
|
|
58
74
|
- **`doctor`** — shows which keys are set, which tools are visible vs hidden and why, and what to try first.
|
|
59
75
|
|
|
60
|
-
#### New tools & skills (
|
|
76
|
+
#### New tools & skills (66 tools · 19 skills)
|
|
61
77
|
- `debug_triage` — ranked root-cause hypotheses with the cheapest discriminating check for each (Grok 4.3)
|
|
62
78
|
- `spec_writer` — loose request → reviewable spec: user stories, Given/When/Then, out-of-scope, open questions (GPT-5.5)
|
|
63
79
|
- `diff_review` / `plan_critique` / `testgen` / `security_review` — multi-model diff review, adversarial plan red-team, test generation, OWASP/CWE audit
|
|
@@ -205,7 +221,7 @@ See [Installation Guide](docs/INSTALLATION_BOTH.md) for detailed instructions.
|
|
|
205
221
|
|
|
206
222
|
---
|
|
207
223
|
|
|
208
|
-
## Tool Ecosystem (
|
|
224
|
+
## Tool Ecosystem (66 Tools)
|
|
209
225
|
|
|
210
226
|
### Research & Search (6)
|
|
211
227
|
`perplexity_ask` · `perplexity_reason` · `grok_search` · `grok_search_lite` · `openai_search` · `gemini_search`
|
|
@@ -7,15 +7,20 @@
|
|
|
7
7
|
// OPENAI MODELS (provider-based naming)
|
|
8
8
|
// =============================================================================
|
|
9
9
|
// GPT-5.6 released Jul 9, 2026 - CURRENT. Three durable tiers replace the pro/mini split:
|
|
10
|
-
// sol (flagship $5/$30) / terra (balanced $2
|
|
10
|
+
// sol (flagship $5/$30) / terra (balanced $2/$12) / luna (fast $0.20/$1.20). 1.05M ctx, 128K out.
|
|
11
|
+
// Jul 30, 2026 price cut: luna -80%, terra -20%, sol unchanged. Verified Aug 12, 2026.
|
|
12
|
+
// No Codex-specific API model exists (no gpt-5.6-codex / codex-max) — the CODEX* aliases
|
|
13
|
+
// below are legacy names repointed onto the sol/terra/luna tiers.
|
|
11
14
|
// "Pro" is no longer a model: sol + reasoning.effort (the $30/$180 gpt-5.5-pro tier is gone).
|
|
12
15
|
// GPT-5.5 (Apr 23, 2026) kept as fallback. OpenRouter uses prefix: openai/gpt-5.6-sol etc.
|
|
13
16
|
export const OPENAI_MODELS = {
|
|
14
17
|
// GPT-5.6 tiers (Jul 9, 2026 - CURRENT)
|
|
15
18
|
DEFAULT: "gpt-5.6-sol", // Flagship: coding/agentic SOTA, 54% more token-efficient than 5.5
|
|
16
19
|
SOL: "gpt-5.6-sol", // Explicit tier alias (also aliased "gpt-5.6" server-side)
|
|
17
|
-
TERRA: "gpt-5.6-terra", // Balanced:
|
|
18
|
-
LUNA: "gpt-5.6-luna", // Fast/cheap: $1
|
|
20
|
+
TERRA: "gpt-5.6-terra", // Balanced: gpt-5.5-level at $2/$12 (Jul 30, 2026 cut: -20%)
|
|
21
|
+
LUNA: "gpt-5.6-luna", // Fast/cheap: $0.20/$1.20 after the Jul 30, 2026 -80% cut.
|
|
22
|
+
// Now ~9x cheaper than terra, not 2.5x — worth routing to it
|
|
23
|
+
// far more aggressively. (Weak long-context recall: avoid huge inputs.)
|
|
19
24
|
MINI: "gpt-5.6-luna", // "mini" tier successor (was gpt-5.4-mini)
|
|
20
25
|
PRO: "gpt-5.6-sol", // Pro tier eliminated in 5.6 — sol + reasoning.effort xhigh (was gpt-5.5-pro $30/$180)
|
|
21
26
|
// GPT-5.5 (Apr 2026) - fallback
|
|
@@ -38,13 +43,17 @@ export const OPENROUTER_PREFIX_MAP = {
|
|
|
38
43
|
"gpt-5.4-mini": "openai/",
|
|
39
44
|
};
|
|
40
45
|
// OpenAI Reasoning Effort Levels (for models that support it)
|
|
41
|
-
//
|
|
46
|
+
// All three GPT-5.6 tiers (sol/terra/luna) accept the full range; medium is the API default.
|
|
42
47
|
export const OPENAI_REASONING = {
|
|
43
48
|
NONE: "none", // No extra reasoning (fastest, allows temperature)
|
|
44
|
-
LOW: "low", // Light reasoning
|
|
45
|
-
MEDIUM: "medium", // Balanced reasoning (default)
|
|
49
|
+
LOW: "low", // Light reasoning — right for grounded web-search lookups
|
|
50
|
+
MEDIUM: "medium", // Balanced reasoning (API default)
|
|
46
51
|
HIGH: "high", // Strong reasoning ("thinking" mode)
|
|
47
|
-
XHIGH: "xhigh", //
|
|
52
|
+
XHIGH: "xhigh", // Very thorough
|
|
53
|
+
MAX: "max", // Ceiling (verified Aug 12, 2026 against OpenAI model docs — this tier
|
|
54
|
+
// was missing here, so nothing in the codebase could request it and the
|
|
55
|
+
// "premium" path topped out one level below what sol actually offers).
|
|
56
|
+
// Reserve for hardest quality-first tasks; compare against xhigh first.
|
|
48
57
|
};
|
|
49
58
|
// =============================================================================
|
|
50
59
|
// GEMINI MODELS (Google)
|
|
@@ -75,15 +84,20 @@ export const PERPLEXITY_MODELS = {
|
|
|
75
84
|
SONAR_PRO: "sonar-pro", // Advanced search
|
|
76
85
|
SONAR_REASONING: "sonar-reasoning-pro", // Reasoning model (expensive - avoid)
|
|
77
86
|
};
|
|
78
|
-
// Grok Models (xAI) - Re-verified 2026-
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
// behind it. Nothing is official yet (no ID, pricing, or context window). Check before bumping.
|
|
87
|
+
// Grok Models (xAI) - Re-verified 2026-08-14 against GET /v1/models: Grok 4.6 has shipped and is
|
|
88
|
+
// the current latest. Catalog: grok-4.20-0309-* (x3), grok-4.3, grok-4.5, grok-4.6, grok-build-0.1,
|
|
89
|
+
// plus grok-imagine image/video. grok-4.7 and grok-5 do NOT exist yet.
|
|
82
90
|
// Also verified absent: grok-code-fast-2 (unannounced) and grok-build-0.2 (docs still list 0.1 only).
|
|
83
91
|
export const GROK_MODELS = {
|
|
84
|
-
// Grok 4.
|
|
92
|
+
// Grok 4.6 (Aug 2026) - CURRENT LATEST — verified against /v1/models on 2026-08-14.
|
|
93
|
+
// 500K ctx, $2/$6 (same as 4.5), cached input $0.50/M (vs 4.5's $0.30/M). No `-latest` alias yet.
|
|
94
|
+
// CRITICAL for search: 4.6 actually invokes web_search on the Agent Tools API; 4.5 does NOT
|
|
95
|
+
// (returns ungrounded training-data answers with zero web_search_call entries).
|
|
96
|
+
_4_6: "grok-4.6", // Latest: 500K ctx, $2/$6, cached $0.50/M
|
|
97
|
+
// Grok 4.5 (Jul 8, 2026) - previous flagship ("Opus-class")
|
|
85
98
|
// 500K context (SMALLER than 4.3's 1M — fine for tools, mind huge inputs), $2/$6,
|
|
86
99
|
// configurable reasoning effort. EU API access landed Jul 17, 2026 — 4.3 kept as quota/region fallback.
|
|
100
|
+
// WARNING: does not invoke web_search on /v1/responses — do not pin search paths to it.
|
|
87
101
|
_4_5: "grok-4.5", // Flagship: 500K ctx, $2/$6, reasoning.effort low|high
|
|
88
102
|
// Grok 4.3 (Apr 30, 2026) - previous flagship, kept as FALLBACK
|
|
89
103
|
// 1M context, $1.25/$2.50, lowest verified hallucination rate.
|
|
@@ -95,8 +109,15 @@ export const GROK_MODELS = {
|
|
|
95
109
|
_4_20_NON_REASONING: "grok-4.5", // [deprecated key] → grok-4.5 (was grok-4.20-0309-non-reasoning)
|
|
96
110
|
_4_20_MULTI_AGENT: "grok-4.5", // [deprecated key] → grok-4.5 (architect uses high reasoning.effort)
|
|
97
111
|
// Grok 4.1 fast models (Nov 2025) - BEST VALUE (10x cheaper)
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
// RETIRED by xAI — verified Aug 12, 2026. DO NOT WIRE THESE TO ANYTHING.
|
|
113
|
+
// The retirement is invisible at runtime: xAI answers a request for these ids with
|
|
114
|
+
// HTTP 200 and silently serves grok-4.3, disclosing the swap only in the response
|
|
115
|
+
// body's `model` field. Nothing throws, so no fallback or try/catch can detect it —
|
|
116
|
+
// you just quietly pay grok-4.3 rates ($1.25/$2.50) while believing you pay $0.20/$0.50.
|
|
117
|
+
// Kept only so existing references resolve to a real (substituted) model rather than
|
|
118
|
+
// breaking; grok_search_lite was moved off them and onto _4_3 explicitly.
|
|
119
|
+
_4_1_FAST_REASONING: "grok-4-1-fast-reasoning", // [RETIRED → serves grok-4.3]
|
|
120
|
+
_4_1_FAST_NON_REASONING: "grok-4-1-fast-non-reasoning", // [RETIRED → serves grok-4.3]
|
|
100
121
|
// Grok 4 fast models (2025) - Still good
|
|
101
122
|
CODE_FAST: "grok-code-fast-1", // Coding specialist: 256K→2M, $0.20/$1.50, 92 tok/sec
|
|
102
123
|
_4_FAST_REASONING: "grok-4-fast-reasoning", // Cheap reasoning: 2M→4M, $0.20/$0.50
|
|
@@ -131,6 +152,8 @@ export const MINIMAX_MODELS = {
|
|
|
131
152
|
// Qwen3 235B Thinking (July 2025) - Largest reasoning model available
|
|
132
153
|
// Qwen3-Coder-Next (Feb 2026) - Agentic coding specialist, 80B/3B MoE, 262K context
|
|
133
154
|
export const QWEN_MODELS = {
|
|
155
|
+
MAX_3_8: "qwen/qwen3.8-max", // Aug 3, 2026: CURRENT flagship reasoning model — 1M ctx, multimodal (text+image+video), reasoning_effort, $2/$6
|
|
156
|
+
MAX_3_7: "qwen/qwen3.7-max", // May 21, 2026: previous flagship, 1M ctx, agent-centric, $1.475/$4.425 (fallback)
|
|
134
157
|
PLUS_3_7: "qwen/qwen3.7-plus", // Jun 3, 2026: general-purpose flagship, 1M ctx, multimodal, $0.32/$1.28
|
|
135
158
|
PLUS_3_6: "qwen/qwen3.6-plus", // Apr 2026: previous general-purpose flagship (legacy)
|
|
136
159
|
CODER_NEXT: "qwen/qwen3-coder-next", // 80B/3B MoE, 262K ctx, SWE-Bench >70%, $0.14/$0.80 (still PRIMARY coder — no 3.6-coder yet)
|
|
@@ -193,19 +216,25 @@ export const CURRENT_MODELS = {
|
|
|
193
216
|
default: OPENAI_MODELS.DEFAULT, // gpt-5.6-sol - flagship, agentic/coding SOTA (Jul 2026)
|
|
194
217
|
reason: OPENAI_MODELS.DEFAULT, // Deep reasoning (sol + effort=high)
|
|
195
218
|
brainstorm: OPENAI_MODELS.DEFAULT, // Creative ideation (sol + effort=medium)
|
|
196
|
-
code: OPENAI_MODELS.TERRA, // Code tasks (gpt-5.6-terra - 5.5-level at
|
|
197
|
-
explain: OPENAI_MODELS.LUNA, // Explanations (gpt-5.6-luna - $1
|
|
198
|
-
search: OPENAI_MODELS.
|
|
199
|
-
//
|
|
200
|
-
|
|
219
|
+
code: OPENAI_MODELS.TERRA, // Code tasks (gpt-5.6-terra - 5.5-level at $2/$12)
|
|
220
|
+
explain: OPENAI_MODELS.LUNA, // Explanations (gpt-5.6-luna - $0.20/$1.20, fast)
|
|
221
|
+
search: OPENAI_MODELS.TERRA, // Web search: $10/1k call fee is flat across tiers,
|
|
222
|
+
// so terra ($2/$12) does grounded lookup at 2.5x less
|
|
223
|
+
// token cost than sol. All 5.6 tiers support web_search.
|
|
224
|
+
// Premium: the 5.5-pro tier ($30/$180) is gone — sol + effort=max replaces it at $5/$30
|
|
225
|
+
premium: OPENAI_MODELS.PRO, // Expert mode (gpt-5.6-sol + reasoning.effort=max)
|
|
201
226
|
},
|
|
202
227
|
grok: {
|
|
203
228
|
reason: GROK_MODELS._4_5, // grok-4.5 (Jul 2026 flagship, high reasoning effort)
|
|
204
229
|
code: GROK_MODELS._4_5, // grok-4.5 (flagship quality, tool-calling)
|
|
205
230
|
debug: GROK_MODELS._4_5, // grok-4.5 (flagship debugging)
|
|
206
231
|
brainstorm: GROK_MODELS._4_5, // grok-4.5 (500K context)
|
|
207
|
-
search: GROK_MODELS.
|
|
208
|
-
|
|
232
|
+
search: GROK_MODELS._4_6, // grok-4.6: the ONLY current model verified (2026-08-14) to
|
|
233
|
+
// actually invoke web_search on /v1/responses — grok-4.5
|
|
234
|
+
// silently answers from training data with zero searches
|
|
235
|
+
search_lite: GROK_MODELS._4_3, // grok-4.3: $1.25/$2.50, 1M ctx — ~1.6x/2.4x cheaper than
|
|
236
|
+
// grok-4.5 search. Was _4_1_FAST_NON_REASONING until that id
|
|
237
|
+
// was retired (xAI silently served 4.3 for it anyway).
|
|
209
238
|
architect: GROK_MODELS._4_5, // grok-4.5 with high reasoning.effort (agentic swarm behaviour)
|
|
210
239
|
},
|
|
211
240
|
gemini: {
|
|
@@ -218,7 +247,7 @@ export const CURRENT_MODELS = {
|
|
|
218
247
|
openrouter: {
|
|
219
248
|
kimi: KIMI_MODELS.K3, // K3 (Jul 16, 2026): 2.8T MoE, 1M ctx, multimodal, agentic coding
|
|
220
249
|
qwen: QWEN_MODELS.CODER_NEXT, // Qwen3-Coder-Next: 80B/3B MoE, 262K ctx, SWE >70% (no 3.6-coder yet)
|
|
221
|
-
qwen_reason: QWEN_MODELS.
|
|
250
|
+
qwen_reason: QWEN_MODELS.MAX_3_8, // Qwen3.8 Max (Aug 3, 2026): flagship reasoning, 1M ctx, high reasoning effort
|
|
222
251
|
minimax: MINIMAX_MODELS.M3, // M3: 1M ctx, MSA sparse attention, agentic/coding
|
|
223
252
|
}
|
|
224
253
|
};
|
|
@@ -329,13 +358,13 @@ export const TOOL_DEFAULTS = {
|
|
|
329
358
|
temperature: 0.5,
|
|
330
359
|
},
|
|
331
360
|
qwen_algo: {
|
|
332
|
-
model: QWEN_MODELS.
|
|
333
|
-
maxTokens: 8000
|
|
361
|
+
model: QWEN_MODELS.MAX_3_8, // Qwen3.8 Max at reasoning_effort "medium" (default effort ≈ high ≈ 5min)
|
|
362
|
+
maxTokens: 12000, // Raised from 8000 — headroom for the visible answer
|
|
334
363
|
temperature: 0.2,
|
|
335
364
|
},
|
|
336
365
|
qwen_reason: {
|
|
337
|
-
model: QWEN_MODELS.
|
|
338
|
-
maxTokens: 8000
|
|
366
|
+
model: QWEN_MODELS.MAX_3_8, // Qwen3.8 Max at reasoning_effort "medium" (default effort ≈ high ≈ 5min)
|
|
367
|
+
maxTokens: 12000, // Raised from 8000 — headroom for the visible answer
|
|
339
368
|
temperature: 0.3, // Lower for precise reasoning
|
|
340
369
|
},
|
|
341
370
|
kimi_thinking: {
|
|
@@ -439,9 +468,9 @@ export function getModelDisplayName(modelId) {
|
|
|
439
468
|
// Model pricing per 1K tokens (input/output average) for cost tracking
|
|
440
469
|
export const MODEL_PRICING = {
|
|
441
470
|
// OpenAI
|
|
442
|
-
"gpt-5.6-sol": 0.0175, // ($5 + $30) / 2 / 1000 (Jul
|
|
443
|
-
"gpt-5.6-terra": 0.
|
|
444
|
-
"gpt-5.6-luna": 0.
|
|
471
|
+
"gpt-5.6-sol": 0.0175, // ($5 + $30) / 2 / 1000 (unchanged in the Jul 30 cut)
|
|
472
|
+
"gpt-5.6-terra": 0.007, // ($2 + $12) / 2 / 1000 (Jul 30, 2026 cut: -20%)
|
|
473
|
+
"gpt-5.6-luna": 0.0007, // ($0.20 + $1.20) / 2 / 1000 (Jul 30, 2026 cut: -80%)
|
|
445
474
|
"gpt-5.5": 0.0175, // ($5 + $30) / 2 / 1000 (Apr 23, 2026 - fallback)
|
|
446
475
|
"gpt-5.5-pro": 0.105, // ($30 + $180) / 2 / 1000 (Apr 23, 2026 - tier removed in 5.6)
|
|
447
476
|
"gpt-5.4": 0.00875, // ($2.50 + $15) / 2 / 1000 (Mar 2026 - legacy)
|
|
@@ -48,7 +48,8 @@ export function getOpenRouterModelTimeout(modelId) {
|
|
|
48
48
|
const id = modelId.toLowerCase();
|
|
49
49
|
if (id.includes('thinking') || id.includes('reasoning') ||
|
|
50
50
|
id.includes('kimi') || id.includes('deepseek') || id.includes('glm') ||
|
|
51
|
-
id.includes('stepfun') || id.includes('ernie')
|
|
51
|
+
id.includes('stepfun') || id.includes('ernie') ||
|
|
52
|
+
id.includes('qwen3.8') || id.includes('qwen3.7-max')) {
|
|
52
53
|
return config.openrouterThinking;
|
|
53
54
|
}
|
|
54
55
|
return config.openrouter;
|
|
@@ -443,7 +443,7 @@ Write concrete, specific analysis. Do NOT include brackets or placeholders.`;
|
|
|
443
443
|
try {
|
|
444
444
|
// Add date context to query
|
|
445
445
|
const dateAwareQuery = `[Current date: ${currentDate}] Verify this claim: "${claim.text}". Is it factually accurate? Provide evidence.`;
|
|
446
|
-
console.
|
|
446
|
+
console.error(`[Challenger] Fact-checking with date context: ${currentDate}`);
|
|
447
447
|
// Use SmartAPIClient with retry logic
|
|
448
448
|
const timeoutConfig = getSmartTimeout(PROVIDER_PERPLEXITY, 'batch');
|
|
449
449
|
const response = await smartAPIClient.callWithRetries(() => this.queryModel('sonar-pro', dateAwareQuery, 1000, 0.3), {
|
|
@@ -485,7 +485,7 @@ Write concrete, specific analysis. Do NOT include brackets or placeholders.`;
|
|
|
485
485
|
// Skip if no programming-specific domains were found
|
|
486
486
|
// This prevents false positives where generic words triggered technical detection
|
|
487
487
|
if (domains.length === 0) {
|
|
488
|
-
console.
|
|
488
|
+
console.error(`Skipping doc verification for claim (no programming domains found): ${claim.text.substring(0, 50)}...`);
|
|
489
489
|
continue;
|
|
490
490
|
}
|
|
491
491
|
// Use Grok search with domain restrictions
|
package/dist/src/modes/scout.js
CHANGED
|
@@ -106,7 +106,7 @@ export class Scout {
|
|
|
106
106
|
// Get current date and prepend to query for temporal context
|
|
107
107
|
const currentDate = getCurrentDate();
|
|
108
108
|
const dateAwareQuery = `[Current date: ${currentDate}] ${query}`;
|
|
109
|
-
console.
|
|
109
|
+
console.error(`[Scout] Date-aware query: ${dateAwareQuery}`);
|
|
110
110
|
// Create progress stream
|
|
111
111
|
const progressStream = createProgressStream(4);
|
|
112
112
|
progressStream.start(`Scout (${options.variant || 'research_scout'})`);
|
|
@@ -350,7 +350,7 @@ export class Scout {
|
|
|
350
350
|
const startTime = Date.now();
|
|
351
351
|
try {
|
|
352
352
|
const enhancedQuery = `Provide comprehensive, current information about: ${query}. Include latest updates, key facts, and reliable sources.`;
|
|
353
|
-
console.
|
|
353
|
+
console.error(`[Scout] Starting deep search for query: ${query}`);
|
|
354
354
|
// Build provider list for failover
|
|
355
355
|
const providers = [];
|
|
356
356
|
if (this.perplexityApiKey) {
|
|
@@ -398,7 +398,7 @@ export class Scout {
|
|
|
398
398
|
return null;
|
|
399
399
|
}
|
|
400
400
|
const searchDuration = Date.now() - startTime;
|
|
401
|
-
console.
|
|
401
|
+
console.error(`[Scout] Deep search completed in ${searchDuration}ms using ${result.provider}`);
|
|
402
402
|
return {
|
|
403
403
|
facts,
|
|
404
404
|
sources: this.extractSources(result.result) || [],
|
|
@@ -2,32 +2,49 @@
|
|
|
2
2
|
* Smart Model Router - Optimized model selection based on query complexity
|
|
3
3
|
* Part of Phase 1A implementation for cost optimization
|
|
4
4
|
*/
|
|
5
|
+
// Tiers refreshed Aug 12, 2026. These were stuck on Mar-2026 models (gpt-5.4,
|
|
6
|
+
// gpt-5.4-pro, gemini-3-flash-preview) — the workflow engine was routing live traffic to
|
|
7
|
+
// a legacy lineup, and estimateCost() fell through to its flat $0.001 default for every
|
|
8
|
+
// current model because none of them were in MODEL_COSTS below.
|
|
5
9
|
export var ModelTier;
|
|
6
10
|
(function (ModelTier) {
|
|
7
|
-
// Tier 0: Cheapest
|
|
8
|
-
ModelTier["ULTRA_CHEAP"] = "gemini-3-flash-
|
|
11
|
+
// Tier 0: Cheapest — Gemini 3.5 Flash-Lite ($0.30/$2.50, Jul 21 2026)
|
|
12
|
+
ModelTier["ULTRA_CHEAP"] = "gemini-3.5-flash-lite";
|
|
9
13
|
// Tier 1: Fast & Efficient
|
|
10
|
-
ModelTier["ULTRA_EFFICIENT"] = "gemini-3-flash
|
|
11
|
-
ModelTier["EFFICIENT"] = "gpt-5.
|
|
12
|
-
// Tier 2: Balanced -
|
|
13
|
-
ModelTier["STANDARD"] = "gpt-5.
|
|
14
|
-
ModelTier["GPT5_MINI"] = "gpt-5.
|
|
15
|
-
// Tier 3: Advanced
|
|
14
|
+
ModelTier["ULTRA_EFFICIENT"] = "gemini-3.6-flash";
|
|
15
|
+
ModelTier["EFFICIENT"] = "gpt-5.6-luna";
|
|
16
|
+
// Tier 2: Balanced — gpt-5.6-terra is gpt-5.5-level at $2/$12
|
|
17
|
+
ModelTier["STANDARD"] = "gpt-5.6-terra";
|
|
18
|
+
ModelTier["GPT5_MINI"] = "gpt-5.6-luna";
|
|
19
|
+
// Tier 3: Advanced
|
|
16
20
|
ModelTier["WEB_SEARCH"] = "perplexity-sonar-pro";
|
|
17
|
-
// Tier 4: Premium (
|
|
18
|
-
ModelTier["GPT5_FULL"] = "gpt-5.
|
|
21
|
+
// Tier 4: Premium (opt-in only)
|
|
22
|
+
ModelTier["GPT5_FULL"] = "gpt-5.6-sol";
|
|
19
23
|
})(ModelTier || (ModelTier = {}));
|
|
24
|
+
// Prices are per 1K tokens (0.005 = $5.00 per 1M). Any model missing here silently
|
|
25
|
+
// falls through to estimateCost()'s flat $0.001 default, so every routable tier above
|
|
26
|
+
// MUST have an entry.
|
|
20
27
|
const MODEL_COSTS = {
|
|
21
|
-
// GPT-5.
|
|
22
|
-
"gpt-5.
|
|
23
|
-
"gpt-5.
|
|
24
|
-
"gpt-5.
|
|
25
|
-
//
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
+
// GPT-5.6 family (Jul 9, 2026; terra/luna repriced Jul 30, 2026)
|
|
29
|
+
"gpt-5.6-sol": { input: 0.005, output: 0.030, latency: 2200 }, // Flagship
|
|
30
|
+
"gpt-5.6-terra": { input: 0.002, output: 0.012, latency: 1300 }, // Balanced (-20%)
|
|
31
|
+
"gpt-5.6-luna": { input: 0.0002, output: 0.0012, latency: 700 }, // Cheap (-80%)
|
|
32
|
+
// GPT-5.5 fallback
|
|
33
|
+
"gpt-5.5": { input: 0.005, output: 0.030, latency: 2000 },
|
|
34
|
+
// Legacy GPT-5.4 (kept so historical workflow runs still cost out)
|
|
35
|
+
"gpt-5.4": { input: 0.0025, output: 0.015, latency: 1500 },
|
|
36
|
+
"gpt-5.4-mini": { input: 0.00075, output: 0.0045, latency: 800 },
|
|
37
|
+
"gpt-5.4-pro": { input: 0.030, output: 0.180, latency: 2500 },
|
|
38
|
+
// Gemini
|
|
39
|
+
"gemini-3.6-flash": { input: 0.0015, output: 0.0075, latency: 600 }, // Jul 21, 2026
|
|
40
|
+
"gemini-3.5-flash-lite": { input: 0.0003, output: 0.0025, latency: 400 }, // Jul 21, 2026
|
|
41
|
+
"gemini-3.5-flash": { input: 0.0015, output: 0.009, latency: 600 }, // May 19, 2026
|
|
42
|
+
"gemini-3.1-pro-preview": { input: 0.002, output: 0.012, latency: 1200 }, // Judge/reasoning default
|
|
43
|
+
"gemini-3-flash-preview": { input: 0.0005, output: 0.003, latency: 500 }, // Legacy
|
|
28
44
|
// Other models
|
|
29
45
|
qwencoder: { input: 0.00015, output: 0.0006, latency: 1000 },
|
|
30
46
|
"perplexity-sonar-pro": { input: 0.006, output: 0.006, latency: 2000 },
|
|
47
|
+
sonar: { input: 0.001, output: 0.001, latency: 1500 },
|
|
31
48
|
};
|
|
32
49
|
export class SmartModelRouter {
|
|
33
50
|
constructor() {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const balancedProfile = {
|
|
2
|
-
description: "Balanced set for general use (
|
|
2
|
+
description: "Balanced set for general use (55 tools)",
|
|
3
3
|
tools: {
|
|
4
4
|
think: true,
|
|
5
5
|
focus: true,
|
|
6
|
+
continue_focus: true,
|
|
6
7
|
tachi: true,
|
|
7
8
|
doctor: true,
|
|
8
9
|
nextThought: true,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const codeFocusProfile = {
|
|
2
|
-
description: "Code-heavy work with debugging and analysis (
|
|
2
|
+
description: "Code-heavy work with debugging and analysis (43 tools)",
|
|
3
3
|
tools: {
|
|
4
4
|
think: true,
|
|
5
5
|
focus: true,
|
|
6
|
+
continue_focus: true,
|
|
6
7
|
tachi: true,
|
|
7
8
|
doctor: true,
|
|
8
9
|
nextThought: true,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const fullProfile = {
|
|
2
|
-
description: "Default profile — all tools enabled for maximum capability (
|
|
2
|
+
description: "Default profile — all tools enabled for maximum capability (66 tools)",
|
|
3
3
|
tools: {
|
|
4
4
|
think: true,
|
|
5
5
|
focus: true,
|
|
6
|
+
continue_focus: true,
|
|
6
7
|
tachi: true,
|
|
7
8
|
doctor: true,
|
|
8
9
|
nextThought: true,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export const heavyCodingProfile = {
|
|
2
|
-
description: "Heavy coding with all reasoning & code tools (
|
|
2
|
+
description: "Heavy coding with all reasoning & code tools (59 tools)",
|
|
3
3
|
tools: {
|
|
4
4
|
// Core reasoning - all enabled
|
|
5
5
|
think: true,
|
|
6
6
|
focus: true,
|
|
7
|
+
continue_focus: true,
|
|
7
8
|
tachi: true,
|
|
8
9
|
doctor: true,
|
|
9
10
|
nextThought: true,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const minimalProfile = {
|
|
2
|
-
description: "Minimal essential tools for basic tasks (
|
|
2
|
+
description: "Minimal essential tools for basic tasks (14 tools)",
|
|
3
3
|
tools: {
|
|
4
4
|
think: true,
|
|
5
5
|
focus: true,
|
|
6
|
+
continue_focus: true,
|
|
6
7
|
tachi: true,
|
|
7
8
|
doctor: true,
|
|
8
9
|
nextThought: true,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const researchPowerProfile = {
|
|
2
|
-
description: "Research-focused with Grok search + all Perplexity + brainstorming (
|
|
2
|
+
description: "Research-focused with Grok search + all Perplexity + brainstorming (37 tools)",
|
|
3
3
|
tools: {
|
|
4
4
|
think: true,
|
|
5
5
|
focus: true,
|
|
6
|
+
continue_focus: true,
|
|
6
7
|
tachi: true,
|
|
7
8
|
doctor: true,
|
|
8
9
|
nextThought: true,
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
* diff_review — multi-model, diff-AWARE code review.
|
|
3
3
|
* Differs from openai_code_review (whole-file, single model) and jury (free-
|
|
4
4
|
* text, no code structure): reviewers are scoped to the changed lines, then a
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* judge dedupes and severity-ranks into ONE actionable list (Gemini, falling back
|
|
6
|
+
* to gpt-5.6-sol, then to raw unmerged findings — see utils/judge-runner.ts).
|
|
7
|
+
* NOTE: still REGISTERED behind a Gemini key (registry.ts:143) even though the judge
|
|
8
|
+
* can now run on OpenAI — relaxing that gate to (Gemini OR OpenAI) is a follow-up.
|
|
7
9
|
*/
|
|
8
10
|
import { z } from "zod";
|
|
9
11
|
import { defineModelTool } from "./factory/define-model-tool.js";
|
|
10
12
|
import { callOpenRouter, OpenRouterModel } from "./openrouter-tools.js";
|
|
11
13
|
import { callOpenAI } from "./openai-tools.js";
|
|
12
|
-
import {
|
|
14
|
+
import { runJudge, judgeAttribution } from "../utils/judge-runner.js";
|
|
13
15
|
import { hasOpenAIApiKey, hasOpenRouterApiKey } from "../utils/api-keys.js";
|
|
14
16
|
import { OPENAI_MODELS } from "../config/model-constants.js";
|
|
15
17
|
import { readFilesIntoContext } from "../utils/file-reader.js";
|
|
@@ -88,7 +90,7 @@ function buildPanel() {
|
|
|
88
90
|
}
|
|
89
91
|
export const diffReviewTool = defineModelTool({
|
|
90
92
|
name: "diff_review",
|
|
91
|
-
description: "Multi-model diff-aware code review: 2-3 lab-diverse reviewers (Kimi K3, DeepSeek V4 Pro, GPT-5.6 Sol) scoped to the changed lines, deduplicated and severity-ranked by a
|
|
93
|
+
description: "Multi-model diff-aware code review: 2-3 lab-diverse reviewers (Kimi K3, DeepSeek V4 Pro, GPT-5.6 Sol) scoped to the changed lines, deduplicated and severity-ranked by a judge. Provide the unified diff in 'diff'.",
|
|
92
94
|
parameters: z.object({
|
|
93
95
|
diff: z.string().describe("Unified diff to review (git diff output) — REQUIRED"),
|
|
94
96
|
intent: z.string().optional().describe("What the change is SUPPOSED to do (enables intent-mismatch detection)"),
|
|
@@ -110,9 +112,15 @@ export const diffReviewTool = defineModelTool({
|
|
|
110
112
|
return "Error: all reviewers failed (provider outage or quota). Try again or run `doctor`.";
|
|
111
113
|
}
|
|
112
114
|
const judgePrompt = buildDiffJudgePrompt(perspectives, args);
|
|
113
|
-
const
|
|
115
|
+
const judged = (await withHeartbeat(() => runJudge(judgePrompt, `You are the presiding code reviewer synthesizing a panel review of one diff. Be decisive; keep only verified findings. ${FORMAT_INSTRUCTION}`, 0.3), reportProgress, 10000));
|
|
114
116
|
const roster = perspectives.map((p) => p.label).join(", ");
|
|
115
|
-
|
|
117
|
+
// Reviewers already ran and billed; hand back their raw findings rather than losing
|
|
118
|
+
// the panel because the synthesis step had no judge available.
|
|
119
|
+
if (judged.text === null) {
|
|
120
|
+
const raw = perspectives.map((p) => `=== ${p.label} ===\n${p.text}`).join("\n\n");
|
|
121
|
+
return `DIFF REVIEW (${perspectives.length} reviewers: ${roster})\n\n⚠️ NO MERGE VERDICT — every judge was unavailable (usually quota). Findings below are UNMERGED and NOT deduplicated or severity-ranked; they may contradict each other or misread the diff.\n\n${raw}`;
|
|
122
|
+
}
|
|
123
|
+
return `DIFF REVIEW (${perspectives.length} reviewers: ${roster})\n\n${judgeAttribution(judged)}${judged.text}`;
|
|
116
124
|
},
|
|
117
125
|
});
|
|
118
126
|
export function getAllDiffReviewTools() {
|