@femtomc/mu-orchestrator 26.2.56 → 26.2.58

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.
@@ -1,8 +1,8 @@
1
+ import { type BackendRunner } from "@femtomc/mu-agent";
1
2
  import { type EventLog } from "@femtomc/mu-core/node";
2
3
  import type { ForumStore } from "@femtomc/mu-forum";
3
4
  import type { IssueStore } from "@femtomc/mu-issue";
4
5
  import type { ModelOverrides } from "./model_resolution.js";
5
- import { type BackendRunner } from "@femtomc/mu-agent";
6
6
  export type DagResult = {
7
7
  status: "root_final" | "no_executable_leaf" | "max_steps_exhausted" | "error";
8
8
  steps: number;
@@ -38,6 +38,11 @@ export type DagRunnerHooks = {
38
38
  export type DagRunnerRunOpts = {
39
39
  hooks?: DagRunnerHooks;
40
40
  };
41
+ type AgentSelfMetadata = {
42
+ model?: string | null;
43
+ thinkingLevel?: string | null;
44
+ };
45
+ export declare function renderAgentSelfMetadata(meta: AgentSelfMetadata): string;
41
46
  export declare class DagRunner {
42
47
  #private;
43
48
  constructor(store: IssueStore, forum: ForumStore, repoRoot: string, opts?: {
@@ -47,4 +52,5 @@ export declare class DagRunner {
47
52
  });
48
53
  run(rootId: string, maxSteps?: number, opts?: DagRunnerRunOpts): Promise<DagResult>;
49
54
  }
55
+ export {};
50
56
  //# sourceMappingURL=dag_runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dag_runner.d.ts","sourceRoot":"","sources":["../src/dag_runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,QAAQ,EAKb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,KAAK,aAAa,EAAgE,MAAM,mBAAmB,CA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1,8 @@
1
1
  import { mkdir } from "node:fs/promises";
2
2
  import { join, relative } from "node:path";
3
+ import { SdkBackend, roleFromTags, systemPromptForRole } from "@femtomc/mu-agent";
3
4
  import { currentRunId, fsEventLogFromRepoRoot, getStorePaths, newRunId, runContext, } from "@femtomc/mu-core/node";
4
5
  import { resolveModelConfig } from "./model_resolution.js";
5
- import { PiSdkBackend, roleFromTags, systemPromptForRole } from "@femtomc/mu-agent";
6
6
  function roundTo(n, digits) {
7
7
  const f = 10 ** digits;
8
8
  return Math.round(n * f) / f;
@@ -16,6 +16,18 @@ function relPath(repoRoot, path) {
16
16
  return path;
17
17
  }
18
18
  }
19
+ function normalizeSelfMetadataValue(value) {
20
+ if (typeof value !== "string") {
21
+ return "unknown";
22
+ }
23
+ const trimmed = value.trim();
24
+ return trimmed.length > 0 ? trimmed : "unknown";
25
+ }
26
+ export function renderAgentSelfMetadata(meta) {
27
+ const model = normalizeSelfMetadataValue(meta.model);
28
+ const thinkingLevel = normalizeSelfMetadataValue(meta.thinkingLevel);
29
+ return `Model: ${model}\nThinking level: ${thinkingLevel}\n`;
30
+ }
19
31
  export class DagRunner {
20
32
  #store;
21
33
  #forum;
@@ -30,13 +42,13 @@ export class DagRunner {
30
42
  this.#forum = forum;
31
43
  this.#repoRoot = repoRoot;
32
44
  this.#events = opts.events ?? fsEventLogFromRepoRoot(repoRoot);
33
- this.#backend = opts.backend ?? new PiSdkBackend();
45
+ this.#backend = opts.backend ?? new SdkBackend();
34
46
  this.#modelOverrides = opts.modelOverrides ?? {};
35
47
  }
36
48
  async #resolveConfig() {
37
49
  return resolveModelConfig(this.#modelOverrides);
38
50
  }
39
- async #renderUserPrompt(issue, rootId, step, attempt = 1) {
51
+ async #renderUserPrompt(issue, rootId, step, attempt = 1, selfMetadata = {}) {
40
52
  let rendered = issue.title ?? "";
41
53
  if (issue.body) {
42
54
  rendered += `\n\n${issue.body}`;
@@ -46,6 +58,7 @@ export class DagRunner {
46
58
  if (runId) {
47
59
  rendered += `Run: ${runId}\n`;
48
60
  }
61
+ rendered += renderAgentSelfMetadata(selfMetadata);
49
62
  if (attempt > 1) {
50
63
  rendered += `\nAttempt: ${attempt} (previous attempt failed — check \`mu forum read issue:${issue.id}\` for context)\n`;
51
64
  }
@@ -54,7 +67,10 @@ export class DagRunner {
54
67
  async #executeBackend(issue, cfg, rootId, step, opts = {}) {
55
68
  const role = roleFromTags(issue.tags);
56
69
  const logSuffix = opts.logSuffix ?? "";
57
- const rendered = await this.#renderUserPrompt(issue, rootId, step, opts.attempt ?? 1);
70
+ const rendered = await this.#renderUserPrompt(issue, rootId, step, opts.attempt ?? 1, {
71
+ model: cfg.model,
72
+ thinkingLevel: cfg.reasoning,
73
+ });
58
74
  const systemPrompt = await systemPromptForRole(role, this.#repoRoot);
59
75
  const { logsDir } = getStorePaths(this.#repoRoot);
60
76
  const rootLogsDir = join(logsDir, rootId);
@@ -66,7 +82,6 @@ export class DagRunner {
66
82
  issueId: issue.id,
67
83
  payload: {
68
84
  role,
69
- cli: cfg.cli,
70
85
  provider: cfg.provider,
71
86
  model: cfg.model,
72
87
  reasoning: cfg.reasoning,
@@ -84,7 +99,6 @@ export class DagRunner {
84
99
  model: cfg.model,
85
100
  thinking: cfg.reasoning,
86
101
  cwd: this.#repoRoot,
87
- cli: cfg.cli,
88
102
  logSuffix,
89
103
  teePath,
90
104
  onLine: opts.onLine,
@@ -94,7 +108,6 @@ export class DagRunner {
94
108
  source: "backend",
95
109
  issueId: issue.id,
96
110
  payload: {
97
- cli: cfg.cli,
98
111
  exit_code: exitCode,
99
112
  elapsed_s: roundTo(elapsedS, 3),
100
113
  tee_path: relPath(this.#repoRoot, teePath),
@@ -5,7 +5,6 @@ export type ModelOverrides = {
5
5
  reasoning?: string;
6
6
  };
7
7
  export type ResolvedModelConfig = {
8
- cli: string;
9
8
  provider: string;
10
9
  model: string;
11
10
  reasoning: string;
@@ -1 +1 @@
1
- {"version":3,"file":"model_resolution.d.ts","sourceRoot":"","sources":["../src/model_resolution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAqBF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,cAAc,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,mBAAmB,CAY5G"}
1
+ {"version":3,"file":"model_resolution.d.ts","sourceRoot":"","sources":["../src/model_resolution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAqBF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,cAAc,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,mBAAmB,CAY5G"}
@@ -52,7 +52,7 @@ function resolveExplicitModel(modelId, providerConstraint, reasoningOverride, au
52
52
  if (!match)
53
53
  continue;
54
54
  if (auth.hasAuth(provider)) {
55
- return { cli: "pi", provider, model: match.id, reasoning: pickReasoning(match, reasoningOverride) };
55
+ return { provider, model: match.id, reasoning: pickReasoning(match, reasoningOverride) };
56
56
  }
57
57
  if (!fallback) {
58
58
  fallback = { provider, model: match };
@@ -60,7 +60,6 @@ function resolveExplicitModel(modelId, providerConstraint, reasoningOverride, au
60
60
  }
61
61
  if (fallback) {
62
62
  return {
63
- cli: "pi",
64
63
  provider: fallback.provider,
65
64
  model: fallback.model.id,
66
65
  reasoning: pickReasoning(fallback.model, reasoningOverride),
@@ -82,7 +81,7 @@ function resolveFromProvider(providerId, reasoningOverride, auth) {
82
81
  throw new Error(`No models available for provider "${providerId}".`);
83
82
  }
84
83
  const best = [...models].sort((a, b) => rankModel(b) - rankModel(a))[0];
85
- return { cli: "pi", provider: providerId, model: best.id, reasoning: pickReasoning(best, reasoningOverride) };
84
+ return { provider: providerId, model: best.id, reasoning: pickReasoning(best, reasoningOverride) };
86
85
  }
87
86
  const PREFERRED_MODEL = "gpt-5.3-codex";
88
87
  function autoDetect(reasoningOverride, auth) {
@@ -101,7 +100,6 @@ function autoDetect(reasoningOverride, auth) {
101
100
  const preferred = authedModels.find((e) => e.model.id === PREFERRED_MODEL && supportsXhigh(e.model));
102
101
  if (preferred) {
103
102
  return {
104
- cli: "pi",
105
103
  provider: preferred.provider,
106
104
  model: preferred.model.id,
107
105
  reasoning: pickReasoning(preferred.model, reasoningOverride),
@@ -109,7 +107,6 @@ function autoDetect(reasoningOverride, auth) {
109
107
  }
110
108
  const best = authedModels.sort((a, b) => rankModel(b.model) - rankModel(a.model))[0];
111
109
  return {
112
- cli: "pi",
113
110
  provider: best.provider,
114
111
  model: best.model.id,
115
112
  reasoning: pickReasoning(best.model, reasoningOverride),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-orchestrator",
3
- "version": "26.2.56",
3
+ "version": "26.2.58",
4
4
  "description": "Long-running execution engine for mu work plans.",
5
5
  "keywords": [
6
6
  "mu",
@@ -21,10 +21,10 @@
21
21
  "dist/**"
22
22
  ],
23
23
  "dependencies": {
24
- "@femtomc/mu-agent": "26.2.54",
25
- "@femtomc/mu-core": "26.2.54",
26
- "@femtomc/mu-forum": "26.2.54",
27
- "@femtomc/mu-issue": "26.2.54",
24
+ "@femtomc/mu-agent": "26.2.57",
25
+ "@femtomc/mu-core": "26.2.57",
26
+ "@femtomc/mu-forum": "26.2.57",
27
+ "@femtomc/mu-issue": "26.2.57",
28
28
  "@mariozechner/pi-coding-agent": "^0.52.12",
29
29
  "@mariozechner/pi-ai": "^0.52.12"
30
30
  }