@mcoda/agents 0.1.129 → 0.1.130

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,13 @@
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.
5
11
 
6
12
  ## 0.1.75
7
13
  - 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":"AAy3BA,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,47 @@ 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 the model default while `mcoda agent details` still
578
+ // showed the configured value. Say so instead, once per distinct value so a
579
+ // long-running process does not repeat itself.
580
+ const warnedReasoningEfforts = new Set();
581
+ const warnUnsupportedReasoningEffort = (raw) => {
582
+ if (warnedReasoningEfforts.has(raw))
583
+ return;
584
+ warnedReasoningEfforts.add(raw);
585
+ process.stderr.write(`[mcoda] codex reasoning effort ${JSON.stringify(raw)} is not one of ` +
586
+ `${CODEX_REASONING_EFFORTS.join(", ")}; using the model default instead.\n`);
587
+ };
575
588
  const normalizeReasoningEffort = (raw) => {
576
589
  if (!raw)
577
590
  return undefined;
578
- const normalized = raw.trim().toLowerCase();
579
- if (!normalized)
591
+ const trimmed = raw.trim();
592
+ if (!trimmed)
580
593
  return undefined;
581
- if (!["low", "medium", "high", "xhigh"].includes(normalized))
594
+ const normalized = normalizeCodexReasoningEffort(trimmed);
595
+ if (!normalized) {
596
+ warnUnsupportedReasoningEffort(trimmed);
582
597
  return undefined;
598
+ }
583
599
  return normalized;
584
600
  };
601
+ // gpt-5.1 tops out at `high`; anything stronger is rejected upstream, so cap it
602
+ // rather than fail the run.
603
+ const GPT_51_MAX_REASONING_EFFORT = "high";
585
604
  const resolveReasoningEffort = (model, effort) => {
586
605
  const configured = normalizeReasoningEffort(effort ?? process.env[CODEX_REASONING_ENV] ?? process.env[CODEX_REASONING_ENV_FALLBACK]);
587
606
  const normalizedModel = (model ?? "").toLowerCase();
588
607
  const isGpt51 = normalizedModel.includes("gpt-5.1");
589
608
  if (configured) {
590
- if (configured === "xhigh" && isGpt51)
591
- return "high";
609
+ if (isGpt51 &&
610
+ codexReasoningEffortRank(configured) > codexReasoningEffortRank(GPT_51_MAX_REASONING_EFFORT)) {
611
+ return GPT_51_MAX_REASONING_EFFORT;
612
+ }
592
613
  return configured;
593
614
  }
594
615
  if (isGpt51)
595
- return "high";
616
+ return GPT_51_MAX_REASONING_EFFORT;
596
617
  return undefined;
597
618
  };
598
619
  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.130",
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.130",
34
+ "@mcoda/shared": "0.1.130"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsc -p tsconfig.json",