@open-mercato/cezar 0.16.1 → 0.16.2-pr1595.3456

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.
@@ -1994,8 +1994,9 @@ export class RunManager {
1994
1994
  * reason back as the route's 409 body. A parent that had no `dispatch` record becomes a root the
1995
1995
  * first time it dispatches: its tree directory is created and its brief written from its own
1996
1996
  * task text. The child forks its worktree off the parent's branch, inherits runner and model
1997
- * unless the order names others, gets a budget carved out of the parent's, and always runs
1998
- * autonomously — a child parked at `waiting` after every turn would need a human per rung.
1997
+ * unless the order names others (a model only on the runner it was picked for), gets a budget
1998
+ * carved out of the parent's, and always runs autonomously — a child parked at `waiting` after
1999
+ * every turn would need a human per rung.
1999
2000
  */
2000
2001
  dispatch(parentId, input,
2001
2002
  /** Internal only (graph nodes — never the route): run the child as this workflow instead of
@@ -2053,13 +2054,20 @@ export class RunManager {
2053
2054
  },
2054
2055
  ],
2055
2056
  };
2057
+ const childRunner = input.runner ?? intent?.runner ?? parent.runner;
2058
+ // An inherited model only follows its own runner: a codex parent's `gpt-*` handed to a
2059
+ // `--runner claude` child fails at spawn (telemetry 43bdda11). Otherwise the child's runner picks.
2060
+ const sameRunner = (runner) => (runner ?? 'claude') === (childRunner ?? 'claude');
2061
+ const childModel = input.model
2062
+ ?? (intent?.model && sameRunner(intent.runner ?? parent.runner) ? intent.model : undefined)
2063
+ ?? (parent.model && sameRunner(parent.runner) ? parent.model : undefined);
2056
2064
  const record = this.startRun(opts.workflow ?? workflow, {
2057
2065
  // The tree directory lines are composed against the id the run is ABOUT to get: `startRun`
2058
2066
  // mints it, so the envelope is finished below once it exists.
2059
2067
  task: childTaskEnvelope(input, { id: parentId, branch: parent.branch }, ['{{TREE_PATHS}}']),
2060
2068
  systemPrompt: composeDispatchPrompt(input.kind),
2061
- runner: input.runner ?? intent?.runner ?? parent.runner,
2062
- ...(input.model ?? intent?.model ?? parent.model ? { model: input.model ?? intent?.model ?? parent.model } : {}),
2069
+ runner: childRunner,
2070
+ ...(childModel ? { model: childModel } : {}),
2063
2071
  autonomous: true,
2064
2072
  dispatch: {
2065
2073
  rootRunId,
@@ -5855,7 +5863,9 @@ export class RunManager {
5855
5863
  // instead of letting the backend silently substitute its default.
5856
5864
  let backendModel;
5857
5865
  try {
5858
- const normalized = normalizeModelForBackend(stepBackend, agentModelsLocked(this.repoRoot) ? undefined : step.model ?? input.model, { configuredProvider: await configuredModelProvider(stepBackend, state.cwd) });
5866
+ const normalized = normalizeModelForBackend(stepBackend,
5867
+ // The task's model was picked for the task's runner; a step on another runner gets its own default.
5868
+ agentModelsLocked(this.repoRoot) ? undefined : step.model ?? (stepBackend === taskBackend ? input.model : undefined), { configuredProvider: await configuredModelProvider(stepBackend, state.cwd) });
5859
5869
  backendModel = normalized?.backendModel;
5860
5870
  // Persist the identity of what ACTUALLY runs (#405, review M1). The run-start echo
5861
5871
  // (line ~993) is best-effort from `taskBackend`/`input.model`; a per-step `runner`/`model`