From 59453b3201a42629caa60167e64abb082ecd415f Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Wed, 1 Jul 2026 14:19:10 +0700 Subject: [PATCH 1/2] feat(agent-interface): expose codex xhigh reasoning --- .changeset/codex-xhigh-reasoning.md | 5 +++++ packages/agent-interface/src/agent-profile.ts | 3 ++- .../agent-interface/src/harness-capabilities.test.ts | 9 +++++++-- packages/agent-interface/src/harness-capabilities.ts | 11 ++++++----- 4 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 .changeset/codex-xhigh-reasoning.md diff --git a/.changeset/codex-xhigh-reasoning.md b/.changeset/codex-xhigh-reasoning.md new file mode 100644 index 0000000..4f2228e --- /dev/null +++ b/.changeset/codex-xhigh-reasoning.md @@ -0,0 +1,5 @@ +--- +"@tangle-network/agent-interface": patch +--- + +Expose Codex `xhigh` reasoning support in harness capability helpers. diff --git a/packages/agent-interface/src/agent-profile.ts b/packages/agent-interface/src/agent-profile.ts index 90e9723..3669542 100644 --- a/packages/agent-interface/src/agent-profile.ts +++ b/packages/agent-interface/src/agent-profile.ts @@ -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" diff --git a/packages/agent-interface/src/harness-capabilities.test.ts b/packages/agent-interface/src/harness-capabilities.test.ts index 3f91eaa..52ae3f2 100644 --- a/packages/agent-interface/src/harness-capabilities.test.ts +++ b/packages/agent-interface/src/harness-capabilities.test.ts @@ -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(["minimal", "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 @@ -144,7 +144,12 @@ describe("reasoning effort support", () => { "low", "medium", ]); - // model ceiling above the harness ceiling can't widen it + expect(reasoningEffortsFor("codex", { maxEffort: "high" })).toEqual([ + "minimal", + "low", + "medium", + "high", + ]); expect(reasoningEffortsFor("codex", { maxEffort: "ultracode" })).toEqual( harnessReasoningEfforts("codex"), ); diff --git a/packages/agent-interface/src/harness-capabilities.ts b/packages/agent-interface/src/harness-capabilities.ts index 8ae1153..7a63dd7 100644 --- a/packages/agent-interface/src/harness-capabilities.ts +++ b/packages/agent-interface/src/harness-capabilities.ts @@ -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 reaches `xhigh` for supported 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). */ @@ -149,7 +150,7 @@ 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); + * - codex: `model_reasoning_effort` accepts `minimal|low|medium|high|xhigh` on supported models; * it has no real `none` (the flag is just omitted), so `none` is dropped — `auto` covers "default". * - 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 @@ -161,7 +162,7 @@ export function snapHarnessToModel( const harnessReasoningEffortsOverride: Partial< Record > = { - codex: ["minimal", "low", "medium", "high"], + codex: ["minimal", "low", "medium", "high", "xhigh"], "claude-code": ["low", "medium", "high", "xhigh", "ultracode"], pi: ["minimal", "low", "medium", "high", "xhigh"], openclaw: ["minimal", "low", "medium", "high", "xhigh"], From aacc5dbbf3bea1331d57ce73c80c3ffdcbc16f7c Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Wed, 1 Jul 2026 15:50:04 +0700 Subject: [PATCH 2/2] fix(agent-interface): remove codex minimal reasoning support --- .changeset/codex-xhigh-reasoning.md | 2 +- packages/agent-interface/src/harness-capabilities.test.ts | 3 +-- packages/agent-interface/src/harness-capabilities.ts | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.changeset/codex-xhigh-reasoning.md b/.changeset/codex-xhigh-reasoning.md index 4f2228e..d76cb51 100644 --- a/.changeset/codex-xhigh-reasoning.md +++ b/.changeset/codex-xhigh-reasoning.md @@ -2,4 +2,4 @@ "@tangle-network/agent-interface": patch --- -Expose Codex `xhigh` reasoning support in harness capability helpers. +Align Codex reasoning support with the live model catalog in harness capability helpers. diff --git a/packages/agent-interface/src/harness-capabilities.test.ts b/packages/agent-interface/src/harness-capabilities.test.ts index 52ae3f2..dc58eb5 100644 --- a/packages/agent-interface/src/harness-capabilities.test.ts +++ b/packages/agent-interface/src/harness-capabilities.test.ts @@ -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", "xhigh"]); + 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 @@ -145,7 +145,6 @@ describe("reasoning effort support", () => { "medium", ]); expect(reasoningEffortsFor("codex", { maxEffort: "high" })).toEqual([ - "minimal", "low", "medium", "high", diff --git a/packages/agent-interface/src/harness-capabilities.ts b/packages/agent-interface/src/harness-capabilities.ts index 7a63dd7..dfbdfe3 100644 --- a/packages/agent-interface/src/harness-capabilities.ts +++ b/packages/agent-interface/src/harness-capabilities.ts @@ -12,7 +12,7 @@ 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 reaches `xhigh` for supported models, kimi is + * 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. @@ -150,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` on supported models; - * 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. @@ -162,7 +162,7 @@ export function snapHarnessToModel( const harnessReasoningEffortsOverride: Partial< Record > = { - codex: ["minimal", "low", "medium", "high", "xhigh"], + codex: ["low", "medium", "high", "xhigh"], "claude-code": ["low", "medium", "high", "xhigh", "ultracode"], pi: ["minimal", "low", "medium", "high", "xhigh"], openclaw: ["minimal", "low", "medium", "high", "xhigh"],