pi-advisor-flow 0.16.1-dev.1 → 0.16.1-dev.2

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
@@ -9,6 +9,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
9
9
  ### Fixed
10
10
 
11
11
  - Prevent `/model` and model cycling from changing the persisted Executor; update it only through `/advisor-models` or an explicit `/advisor executor=...` override.
12
+ - `/advisor-manual` now waits for the consultation in `pi --mode json -p` one-shot runs, so the result (or failure) message is emitted before the process exits instead of being lost to teardown, and no Executor turn is triggered there.
12
13
 
13
14
  ## 0.16.0 - 2026-11-16
14
15
 
package/dist/index.js CHANGED
@@ -7218,7 +7218,7 @@ var screeningSkipText = (outcome) => outcome.kind === "repeat" && outcome.reatta
7218
7218
 
7219
7219
  // src/commands/manual-consultation.ts
7220
7220
  var startManualConsultation = async (runtime, ctx, question, controller, scoutStatusToken, progress, gitContext) => {
7221
- const isPrintMode = ctx.mode === "print";
7221
+ const isOneShot = ctx.mode === "print" || ctx.mode === "json";
7222
7222
  progress.phase = "preparing";
7223
7223
  runtime.requestManualRender(ctx);
7224
7224
  if (uiAvailable(ctx)) {
@@ -7299,7 +7299,7 @@ ${markdown}`,
7299
7299
  display: true
7300
7300
  }, {
7301
7301
  deliverAs: "steer",
7302
- triggerTurn: !isPrintMode
7302
+ triggerTurn: !isOneShot
7303
7303
  });
7304
7304
  } catch (error) {
7305
7305
  if (controller.signal.aborted) {
@@ -7324,7 +7324,7 @@ ${markdown}`,
7324
7324
  text: `**Advisor consultation failed:** ${message}`
7325
7325
  },
7326
7326
  display: true
7327
- }, { deliverAs: "steer", triggerTurn: !isPrintMode });
7327
+ }, { deliverAs: "steer", triggerTurn: !isOneShot });
7328
7328
  notify(ctx, `${t("manualCmd.consultFailed.prefix", "Advisor consultation failed:")} ${message}`, "error");
7329
7329
  notifyHerdrAdvisorFailure("Advisor consultation failed", message);
7330
7330
  } finally {
@@ -7418,7 +7418,7 @@ var registerManualCommand = (runtime) => {
7418
7418
  runtime.scoutStatus.register(scoutStatusToken);
7419
7419
  runtime.manualConsultations.set(controller, scoutStatusToken);
7420
7420
  runtime.pi.appendEntry?.("advisor-manual-call", { progressId, question });
7421
- if (ctx.mode === "print") {
7421
+ if (ctx.mode === "print" || ctx.mode === "json") {
7422
7422
  await startManualConsultation(runtime, ctx, question, controller, scoutStatusToken, progress, gitContext);
7423
7423
  return;
7424
7424
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-advisor-flow",
3
- "version": "0.16.1-dev.1",
3
+ "version": "0.16.1-dev.2",
4
4
  "description": "Advanced Executor/Advisor flow for Pi, fully configurable and extendable.",
5
5
  "keywords": [
6
6
  "advisor",
@@ -123,9 +123,10 @@ export const registerManualCommand = (runtime: CommandRuntime) => {
123
123
  runtime.manualConsultations.set(controller, scoutStatusToken);
124
124
  runtime.pi.appendEntry?.("advisor-manual-call", { progressId, question });
125
125
 
126
- // Print mode tears the session down when the handler returns, so the
127
- // consultation must complete inside the handler to keep its ctx valid.
128
- if (ctx.mode === "print") {
126
+ // One-shot runs (`pi -p`, `pi --mode json -p`) tear the session down
127
+ // when the handler returns, so the consultation must complete inside
128
+ // the handler to keep its ctx valid.
129
+ if (ctx.mode === "print" || ctx.mode === "json") {
129
130
  await startManualConsultation(
130
131
  runtime,
131
132
  ctx,
@@ -34,7 +34,9 @@ export const startManualConsultation = async (
34
34
  progress: ManualAdvisorProgressState,
35
35
  gitContext?: GitContextLevel
36
36
  ) => {
37
- const isPrintMode = ctx.mode === "print";
37
+ // One-shot runs (`pi -p`, `pi --mode json -p`) have no follow-up turn;
38
+ // triggering one trips pi's turn_end entry resolution during teardown.
39
+ const isOneShot = ctx.mode === "print" || ctx.mode === "json";
38
40
  progress.phase = "preparing";
39
41
  runtime.requestManualRender(ctx);
40
42
 
@@ -153,10 +155,8 @@ export const startManualConsultation = async (
153
155
  {
154
156
  // Steer lets the current turn finish its active work; the Executor sees
155
157
  // the result before its next model call rather than being interrupted.
156
- // Print mode has no follow-up turn; triggering one trips pi's turn_end
157
- // entry resolution during teardown.
158
158
  deliverAs: "steer",
159
- triggerTurn: !isPrintMode,
159
+ triggerTurn: !isOneShot,
160
160
  }
161
161
  );
162
162
  } catch (error) {
@@ -185,7 +185,7 @@ export const startManualConsultation = async (
185
185
  },
186
186
  display: true,
187
187
  },
188
- { deliverAs: "steer", triggerTurn: !isPrintMode }
188
+ { deliverAs: "steer", triggerTurn: !isOneShot }
189
189
  );
190
190
  notify(
191
191
  ctx,