Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/codex-xhigh-reasoning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tangle-network/agent-interface": patch
---

Align Codex reasoning support with the live model catalog in harness capability helpers.
3 changes: 2 additions & 1 deletion packages/agent-interface/src/agent-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export interface AgentProfileResources {
* - `minimal` — thinking ON, the lowest budget (distinct from `none`)
* - `low` / `medium` / `high` / `xhigh`
* - `ultracode` — maximum (claude-code's "ultracode" run mode; codex's `max` reconciles here).
* A backend without a matching native tier clamps to its nearest (e.g. codex maps `xhigh`/`ultracode` → `high`).
* A backend without a matching native tier clamps to its nearest (e.g. codex maps `ultracode` → `xhigh`
* on models that support it).
*/
export type ReasoningEffort =
| "none"
Expand Down
8 changes: 6 additions & 2 deletions packages/agent-interface/src/harness-capabilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe("reasoning effort support", () => {
// no-thinking runners
expect(harnessReasoningEfforts("cli-base")).toEqual(["none"]);
// clamp-based: `none` dropped (inert ≡ auto); capped at the adapter's real ceiling
expect(harnessReasoningEfforts("codex")).toEqual(["minimal", "low", "medium", "high"]);
expect(harnessReasoningEfforts("codex")).toEqual(["low", "medium", "high", "xhigh"]);
expect(harnessReasoningEfforts("pi")).toEqual(["minimal", "low", "medium", "high", "xhigh"]);
expect(harnessReasoningEfforts("openclaw")).toEqual(["minimal", "low", "medium", "high", "xhigh"]);
// claude: real `--effort` ladder low…max (ultracode stands in for max); no none/minimal
Expand Down Expand Up @@ -144,7 +144,11 @@ describe("reasoning effort support", () => {
"low",
"medium",
]);
// model ceiling above the harness ceiling can't widen it
expect(reasoningEffortsFor("codex", { maxEffort: "high" })).toEqual([
"low",
"medium",
"high",
]);
expect(reasoningEffortsFor("codex", { maxEffort: "ultracode" })).toEqual(
harnessReasoningEfforts("codex"),
);
Expand Down
13 changes: 7 additions & 6 deletions packages/agent-interface/src/harness-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import { canonicalizeHarness, type HarnessType } from "./harness.js";
* cli-bridge backends, the sandbox UI pickers, and the router all read one truth instead of each
* hand-rolling a divergent copy.
*
* Grounded in cli-bridge's real backend clamps (codex caps at `high`, kimi is binary on/off, claude
* carries the full range, cli-base has no agent) — NOT a guessed matrix. The per-MODEL reasoning
* capability (does this specific model reason at all) is dynamic catalog data the caller supplies.
* Grounded in cli-bridge's real backend clamps (codex is `low..xhigh` for current models, kimi is
* binary on/off, claude carries the full range, cli-base has no agent) — NOT a guessed matrix. The
* per-MODEL reasoning capability (does this specific model reason at all) is dynamic catalog data the
* caller supplies.
*/

/** low → high. `none` = thinking off; `ultracode` = max (claude-code mode). */
Expand Down Expand Up @@ -149,8 +150,8 @@ export function snapHarnessToModel(
/**
* The explicit reasoning-effort set a harness's runtime accepts when it ISN'T a plain `none…ceiling`
* slice — grounded in the cli-bridge adapters (NOT the canonical ladder):
* - codex: `model_reasoning_effort` accepts `minimal|low|medium|high` (xhigh/ultracode clamp down);
* it has no real `none` (the flag is just omitted), so `none` is dropped — `auto` covers "default".
* - codex: current models advertise `low|medium|high|xhigh`; `none` is omitted (use `auto`) and
* legacy `minimal` requests clamp up to `low`.
* - claude-code: `--effort` accepts `low|medium|high|xhigh|max`. `ultracode` is the ladder's stand-in
* for claude's `max` (clamped at runtime); `minimal`→`low` and `none`/`auto`→no flag, so both are
* dropped as redundant.
Expand All @@ -161,7 +162,7 @@ export function snapHarnessToModel(
const harnessReasoningEffortsOverride: Partial<
Record<HarnessType, readonly ReasoningEffort[]>
> = {
codex: ["minimal", "low", "medium", "high"],
codex: ["low", "medium", "high", "xhigh"],
"claude-code": ["low", "medium", "high", "xhigh", "ultracode"],
pi: ["minimal", "low", "medium", "high", "xhigh"],
openclaw: ["minimal", "low", "medium", "high", "xhigh"],
Expand Down
Loading