pi-crew 0.9.59 → 0.9.61

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.
@@ -249,6 +249,25 @@ export interface TeamRunManifest {
249
249
  /** #2 (assessment): goal-achievement verdict — kills the silent false-green. */
250
250
  goalAchieved?: boolean | "unknown";
251
251
  goalAchievementNote?: string;
252
+ /**
253
+ * Model routing snapshot captured at dispatch time. Background/async runs
254
+ * execute in a detached process with no `ExtensionContext`, so without this
255
+ * they lose the caller's `model=` override, the inherited session model and
256
+ * the auth-filtered model catalogue — and silently route to whatever
257
+ * models.json happens to list first.
258
+ */
259
+ modelContext?: RunModelContext;
260
+ }
261
+
262
+ export interface RunModelContext {
263
+ /** `model=` passed to the team tool for this run. */
264
+ override?: string;
265
+ /** The main session's live model at dispatch time (`"provider/id"`). */
266
+ parentModel?: string;
267
+ /** The main session's thinking level at dispatch time. */
268
+ parentThinking?: string;
269
+ /** `"provider/id"` entries from the caller's pi ModelRegistry (auth-filtered). */
270
+ availableModels?: string[];
252
271
  }
253
272
 
254
273
  export interface UsageState {
@@ -348,6 +367,14 @@ export interface ModelRoutingState {
348
367
  fallbackChain: string[];
349
368
  reason?: string;
350
369
  usedAttempt: number;
370
+ /**
371
+ * Set when the caller asked for a model that is not resolvable against the
372
+ * available catalogue, so the chain silently ran something else. Surfaced
373
+ * as a warning in the tool result and doctor output.
374
+ */
375
+ droppedRequested?: string;
376
+ /** How many candidates came from the auto tail (diagnostics). */
377
+ autoFallbackCount?: number;
351
378
  }
352
379
 
353
380
  export interface TaskWorktreeState {
@@ -37,10 +37,17 @@ function parseRoleLine(line: string): TeamRole | undefined {
37
37
  metadata.skills = raw.replace(/\s*,\s*/g, ",").trim();
38
38
  return "";
39
39
  });
40
- descriptionSource = descriptionSource.replace(/\b(agent|model|maxConcurrency)\s*=\s*(\S+)/g, (_match, key: string, raw: string) => {
41
- metadata[key] = raw.trim();
40
+ descriptionSource = descriptionSource.replace(/\bfallbackModels\s*=\s*([\w/.:-]+(?:\s*,\s*[\w/.:-]+)*)/g, (_match, raw: string) => {
41
+ metadata.fallbackModels = raw.replace(/\s*,\s*/g, ",").trim();
42
42
  return "";
43
43
  });
44
+ descriptionSource = descriptionSource.replace(
45
+ /\b(agent|model|thinking|maxConcurrency)\s*=\s*(\S+)/g,
46
+ (_match, key: string, raw: string) => {
47
+ metadata[key] = raw.trim();
48
+ return "";
49
+ },
50
+ );
44
51
  const description = descriptionSource.replace(/\s+/g, " ").trim() || undefined;
45
52
  const maxConcurrency = metadata.maxConcurrency
46
53
  ? (() => {
@@ -53,6 +60,13 @@ function parseRoleLine(line: string): TeamRole | undefined {
53
60
  agent: metadata.agent ?? name,
54
61
  description,
55
62
  model: metadata.model,
63
+ fallbackModels: metadata.fallbackModels
64
+ ? metadata.fallbackModels
65
+ .split(",")
66
+ .map((s) => s.trim())
67
+ .filter(Boolean)
68
+ : undefined,
69
+ thinking: metadata.thinking?.trim() || undefined,
56
70
  skills: parseRoleSkills(metadata.skills),
57
71
  maxConcurrency: maxConcurrency && maxConcurrency > 0 ? maxConcurrency : undefined,
58
72
  };
@@ -5,6 +5,10 @@ export interface TeamRole {
5
5
  agent: string;
6
6
  description?: string;
7
7
  model?: string;
8
+ /** Comma-separated fallback models declared on the role line. */
9
+ fallbackModels?: string[];
10
+ /** Thinking level for this role (e.g. "high", "medium", "low", "off"). */
11
+ thinking?: string;
8
12
  /** Additional skills for this role; false disables role-default injected skills for tasks using this role. */
9
13
  skills?: string[] | false;
10
14
  maxConcurrency?: number;