pi-subagents 0.51.0 → 0.52.0

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/agents/oracle.md +3 -1
  3. package/agents/reviewer.md +1 -0
  4. package/agents/scout.md +2 -2
  5. package/agents/worker.md +2 -1
  6. package/docs/agents.md +8 -3
  7. package/docs/extension-api.md +1 -1
  8. package/docs/models.md +2 -0
  9. package/docs/observability.md +37 -1
  10. package/docs/workflows.md +2 -0
  11. package/package.json +1 -1
  12. package/skills/pi-subagents/SKILL.md +1 -0
  13. package/skills/pi-subagents/references/constraints-and-recipes.md +6 -2
  14. package/skills/pi-subagents/references/execution-controls.md +12 -1
  15. package/skills/pi-subagents/references/prompting-and-roles.md +2 -0
  16. package/src/agents/agent-management.ts +24 -6
  17. package/src/agents/agents.ts +37 -11
  18. package/src/agents/skills.ts +1 -1
  19. package/src/api/preflight.ts +5 -2
  20. package/src/extension/index.ts +1 -0
  21. package/src/extension/public-execution.ts +3 -1
  22. package/src/intercom/native-supervisor-channel.ts +2 -1
  23. package/src/missions/workflow-state.ts +2 -2
  24. package/src/runs/background/async-execution.ts +19 -9
  25. package/src/runs/background/async-resume.ts +19 -2
  26. package/src/runs/background/async-retention.ts +2 -4
  27. package/src/runs/background/completion-dedupe.ts +5 -1
  28. package/src/runs/background/completion-replay.ts +22 -12
  29. package/src/runs/background/fleet-view.ts +68 -19
  30. package/src/runs/background/inspect-rpc.ts +443 -0
  31. package/src/runs/background/notify.ts +28 -4
  32. package/src/runs/background/result-watcher.ts +44 -0
  33. package/src/runs/background/resume-guidance.ts +8 -5
  34. package/src/runs/background/scheduled-runs.ts +2 -0
  35. package/src/runs/background/subagent-runner.ts +3 -2
  36. package/src/runs/background/subagent-wait.ts +1 -1
  37. package/src/runs/background/wait-subscriptions.ts +1 -1
  38. package/src/runs/foreground/execution.ts +1 -1
  39. package/src/runs/foreground/subagent-executor.ts +239 -76
  40. package/src/runs/foreground/workflow-detach-reconcile.ts +194 -0
  41. package/src/runs/shared/acceptance.ts +4 -4
  42. package/src/runs/shared/external-job-bridge.ts +0 -6
  43. package/src/runs/shared/model-fallback.ts +77 -34
  44. package/src/runs/shared/session-lease.ts +0 -6
  45. package/src/runs/shared/worktree.ts +2 -1
  46. package/src/shared/types.ts +11 -0
  47. package/src/slash/slash-bridge.ts +2 -1
  48. package/src/slash/slash-commands.ts +18 -0
  49. package/src/watchdog/change-signature.ts +1 -1
  50. package/src/watchdog/lsp-diagnostics.ts +1 -0
  51. package/src/workflows/chat-progress.ts +1 -1
  52. package/src/workflows/scripted-workflow.ts +13 -2
  53. package/agents/gpt-pro.md +0 -17
@@ -1064,7 +1064,7 @@ async function exportSessionHtml(sessionFile: string, outputDir: string, piPacka
1064
1064
 
1065
1065
  function createShareLink(htmlPath: string): { shareUrl: string; gistUrl: string } | { error: string } {
1066
1066
  try {
1067
- const auth = spawnSync("gh", ["auth", "status"], { encoding: "utf-8" });
1067
+ const auth = spawnSync("gh", ["auth", "status"], { encoding: "utf-8", windowsHide: true });
1068
1068
  if (auth.status !== 0) {
1069
1069
  return { error: "GitHub CLI is not logged in. Run 'gh auth login' first." };
1070
1070
  }
@@ -1073,7 +1073,7 @@ function createShareLink(htmlPath: string): { shareUrl: string; gistUrl: string
1073
1073
  }
1074
1074
 
1075
1075
  try {
1076
- const result = spawnSync("gh", ["gist", "create", htmlPath], { encoding: "utf-8" });
1076
+ const result = spawnSync("gh", ["gist", "create", htmlPath], { encoding: "utf-8", windowsHide: true });
1077
1077
  if (result.status !== 0) {
1078
1078
  const err = (result.stderr || "").trim() || "Failed to create gist.";
1079
1079
  return { error: err };
@@ -4890,6 +4890,7 @@ async function runSubagent(
4890
4890
  statusPayload.error = `Step failed: ${failedStep.agent}`;
4891
4891
  }
4892
4892
  }
4893
+ writeStatusPayload();
4893
4894
  try {
4894
4895
  runPersistence.write(resultPath, {
4895
4896
  lifecycleArtifactVersion: SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
@@ -226,7 +226,7 @@ function summarizeForegroundChildren(run: ForegroundResumeRun, indices: Set<numb
226
226
  }
227
227
 
228
228
  function foregroundChildrenNeedingAttention(run: ForegroundResumeRun, indices: Set<number>) {
229
- return run.children.filter((child) => indices.has(child.index) && child.status === "detached" && child.activityState === "needs_attention");
229
+ return run.children.filter((child) => indices.has(child.index) && child.status === "detached" && child.activityState === "needs_attention" && child.currentTool === "contact_supervisor");
230
230
  }
231
231
 
232
232
  function formatForegroundAttention(run: ForegroundResumeRun, children: ReturnType<typeof foregroundChildrenNeedingAttention>, elapsedMs: number): AgentToolResult<Details> {
@@ -217,7 +217,7 @@ export function createWaitSubscriptionManager(
217
217
  return;
218
218
  }
219
219
  const detached = run.children.filter((child) => child.status === "detached");
220
- if (detached.some((child) => child.activityState === "needs_attention")) {
220
+ if (detached.some((child) => child.activityState === "needs_attention" && child.currentTool === "contact_supervisor")) {
221
221
  settle(record, "needs attention", "Reply to the pending supervisor request or inspect the run status.");
222
222
  return;
223
223
  }
@@ -1673,7 +1673,7 @@ async function runSyncCompletionInner(
1673
1673
  agent.fallbackModels,
1674
1674
  options.availableModels,
1675
1675
  options.preferredModelProvider,
1676
- { scope: options.modelScope },
1676
+ { scope: options.modelScope, primaryModelFromParent: options.modelOverrideFromParent },
1677
1677
  );
1678
1678
  const attemptedModels: string[] = [];
1679
1679
  const modelAttempts: ModelAttempt[] = [];