@mcoda/agents 0.1.129 → 0.1.131

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 CHANGED
@@ -1,7 +1,14 @@
1
1
  # Changelog
2
2
 
3
3
  ## Unreleased
4
- - None.
4
+ - Accept every reasoning effort codex-cli accepts
5
+ (`minimal|low|medium|high|xhigh|max|ultra`) instead of only
6
+ `low|medium|high|xhigh`, so `max` and `ultra` reach
7
+ `-c model_reasoning_effort=...` instead of being dropped for the model
8
+ default. The gpt-5.1 ceiling now caps anything above `high` rather than only
9
+ `xhigh`, and an effort outside the enum is reported on stderr instead of
10
+ being ignored silently. The report names the effort the run falls back to,
11
+ which is the `high` cap on gpt-5.1 and the model default elsewhere.
5
12
 
6
13
  ## 0.1.75
7
14
  - Forward per-agent Codex CLI `reasoningEffort` configuration into `codex exec` so agents such as `codex55` can use `model_reasoning_effort=xhigh` without relying on process-wide environment variables.
@@ -1 +1 @@
1
- {"version":3,"file":"CodexCliRunner.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex/CodexCliRunner.ts"],"names":[],"mappings":"AAu1BA,eAAO,MAAM,UAAU,GAAI,sBAAoB,KAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CA+BjG,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,eAAe,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,YAAY,MAAM,EAClB,kBAAkB,MAAM,KACvB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CASzC,CAAC;AAEF,wBAAuB,kBAAkB,CACvC,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,SAAS,CAAC,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,GACvB,cAAc,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAoFhE"}
1
+ {"version":3,"file":"CodexCliRunner.d.ts","sourceRoot":"","sources":["../../../src/adapters/codex/CodexCliRunner.ts"],"names":[],"mappings":"AAo4BA,eAAO,MAAM,UAAU,GAAI,sBAAoB,KAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CA+BjG,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,eAAe,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,YAAY,MAAM,EAClB,kBAAkB,MAAM,KACvB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CASzC,CAAC;AAEF,wBAAuB,kBAAkB,CACvC,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,SAAS,CAAC,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,GACvB,cAAc,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAoFhE"}
@@ -2,6 +2,7 @@ import { spawn, spawnSync } from "node:child_process";
2
2
  import { mkdtemp, rm, writeFile } from "node:fs/promises";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
+ import { CODEX_REASONING_EFFORTS, codexReasoningEffortRank, normalizeCodexReasoningEffort, } from "@mcoda/shared";
5
6
  const CODEX_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
6
7
  const CODEX_REASONING_ENV = "MCODA_CODEX_REASONING_EFFORT";
7
8
  const CODEX_REASONING_ENV_FALLBACK = "CODEX_REASONING_EFFORT";
@@ -572,27 +573,54 @@ const createStreamFormatter = (model) => {
572
573
  };
573
574
  return { handleLine, end };
574
575
  };
576
+ // An effort codex does not accept used to be dropped without a trace: the run
577
+ // silently fell back to whatever the model would have used anyway while
578
+ // `mcoda agent details` still showed the configured value. Say so instead, and
579
+ // name the effort actually used, which is not always the model default -- on
580
+ // gpt-5.1 the fallback below is `high`. Deduped per distinct (value, fallback)
581
+ // pair so a long-running process does not repeat itself.
582
+ const warnedReasoningEfforts = new Set();
583
+ const warnUnsupportedReasoningEffort = (raw, fallback) => {
584
+ const key = `${raw}\u0000${fallback ?? ""}`;
585
+ if (warnedReasoningEfforts.has(key))
586
+ return;
587
+ warnedReasoningEfforts.add(key);
588
+ const used = fallback ? `${JSON.stringify(fallback)}` : "the model default";
589
+ process.stderr.write(`[mcoda] codex reasoning effort ${JSON.stringify(raw)} is not one of ` +
590
+ `${CODEX_REASONING_EFFORTS.join(", ")}; using ${used} instead.\n`);
591
+ };
592
+ // Returns the recognised effort, or the raw text under `rejected` so the caller
593
+ // can report it once it knows which fallback the model will actually get.
575
594
  const normalizeReasoningEffort = (raw) => {
576
595
  if (!raw)
577
- return undefined;
578
- const normalized = raw.trim().toLowerCase();
596
+ return {};
597
+ const trimmed = raw.trim();
598
+ if (!trimmed)
599
+ return {};
600
+ const normalized = normalizeCodexReasoningEffort(trimmed);
579
601
  if (!normalized)
580
- return undefined;
581
- if (!["low", "medium", "high", "xhigh"].includes(normalized))
582
- return undefined;
583
- return normalized;
602
+ return { rejected: trimmed };
603
+ return { effort: normalized };
584
604
  };
605
+ // gpt-5.1 tops out at `high`; anything stronger is rejected upstream, so cap it
606
+ // rather than fail the run.
607
+ const GPT_51_MAX_REASONING_EFFORT = "high";
585
608
  const resolveReasoningEffort = (model, effort) => {
586
- const configured = normalizeReasoningEffort(effort ?? process.env[CODEX_REASONING_ENV] ?? process.env[CODEX_REASONING_ENV_FALLBACK]);
609
+ const { effort: configured, rejected } = normalizeReasoningEffort(effort ?? process.env[CODEX_REASONING_ENV] ?? process.env[CODEX_REASONING_ENV_FALLBACK]);
587
610
  const normalizedModel = (model ?? "").toLowerCase();
588
611
  const isGpt51 = normalizedModel.includes("gpt-5.1");
612
+ if (rejected) {
613
+ warnUnsupportedReasoningEffort(rejected, isGpt51 ? GPT_51_MAX_REASONING_EFFORT : undefined);
614
+ }
589
615
  if (configured) {
590
- if (configured === "xhigh" && isGpt51)
591
- return "high";
616
+ if (isGpt51 &&
617
+ codexReasoningEffortRank(configured) > codexReasoningEffortRank(GPT_51_MAX_REASONING_EFFORT)) {
618
+ return GPT_51_MAX_REASONING_EFFORT;
619
+ }
592
620
  return configured;
593
621
  }
594
622
  if (isGpt51)
595
- return "high";
623
+ return GPT_51_MAX_REASONING_EFFORT;
596
624
  return undefined;
597
625
  };
598
626
  const extractAssistantText = (parsed) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcoda/agents",
3
- "version": "0.1.129",
3
+ "version": "0.1.131",
4
4
  "description": "Agent registry and capabilities for mcoda.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,8 +30,8 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
- "@mcoda/db": "0.1.129",
34
- "@mcoda/shared": "0.1.129"
33
+ "@mcoda/db": "0.1.131",
34
+ "@mcoda/shared": "0.1.131"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsc -p tsconfig.json",