pi-studio 0.5.17 → 0.5.19

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
@@ -4,6 +4,17 @@ All notable changes to `pi-studio` are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.5.19] — 2026-03-19
8
+
9
+ ### Fixed
10
+ - Studio now waits until `agent_end` before emitting the terminal/cmux “response ready” notification for completed requests, and it keeps the cmux `running…` status pill visible until that same turn fully finishes.
11
+
12
+ ## [0.5.18] — 2026-03-17
13
+
14
+ ### Fixed
15
+ - cmux sidebar Studio status pills now use a darker blue in light mode, making `running…` / `compacting…` much easier to read.
16
+ - The annotated-reply header wording in Studio now says `user annotation syntax: [an: note]`, matching the intended user-guidance semantics more clearly.
17
+
7
18
  ## [0.5.17] — 2026-03-17
8
19
 
9
20
  ### Fixed
@@ -3364,7 +3364,7 @@
3364
3364
  const sourceDescriptor = describeSourceForAnnotation();
3365
3365
  let header = "annotated reply below:\n";
3366
3366
  header += "original source: " + sourceDescriptor + "\n";
3367
- header += "annotation syntax: [an: your note]\n";
3367
+ header += "user annotation syntax: [an: note]\n";
3368
3368
  header += "precedence: later messages supersede these annotations unless user explicitly references them\n\n---\n\n";
3369
3369
  return header;
3370
3370
  }
package/index.ts CHANGED
@@ -160,6 +160,8 @@ const UPDATE_CHECK_TIMEOUT_MS = 1800;
160
160
  const CMUX_NOTIFY_TIMEOUT_MS = 1200;
161
161
  const STUDIO_TERMINAL_NOTIFY_TITLE = "pi Studio";
162
162
  const CMUX_STUDIO_STATUS_KEY = "pi_studio";
163
+ const CMUX_STUDIO_STATUS_COLOR_DARK = "#5ea1ff";
164
+ const CMUX_STUDIO_STATUS_COLOR_LIGHT = "#0047ab";
163
165
 
164
166
  const PDF_PREAMBLE = `\\usepackage{titlesec}
165
167
  \\titleformat{\\section}{\\Large\\bfseries\\sffamily}{}{0pt}{}[\\vspace{2pt}\\titlerule]
@@ -2950,6 +2952,7 @@ export default function (pi: ExtensionAPI) {
2950
2952
  let lastCommandCtx: ExtensionCommandContext | null = null;
2951
2953
  let lastThemeVarsJson = "";
2952
2954
  let suppressedStudioResponse: { requestId: string; kind: StudioRequestKind } | null = null;
2955
+ let pendingStudioCompletionKind: StudioRequestKind | null = null;
2953
2956
  let agentBusy = false;
2954
2957
  let terminalActivityPhase: TerminalActivityPhase = "idle";
2955
2958
  let terminalActivityToolName: string | null = null;
@@ -3139,16 +3142,22 @@ export default function (pi: ExtensionAPI) {
3139
3142
  runCmuxCommand(["clear-notifications"]);
3140
3143
  };
3141
3144
 
3145
+ const getCmuxStudioStatusColor = (): string => {
3146
+ const mode = getStudioThemeMode(lastCommandCtx?.ui?.theme);
3147
+ return mode === "light" ? CMUX_STUDIO_STATUS_COLOR_LIGHT : CMUX_STUDIO_STATUS_COLOR_DARK;
3148
+ };
3149
+
3142
3150
  const syncCmuxStudioStatus = () => {
3143
3151
  if (!shouldUseCmuxTerminalIntegration()) return;
3144
3152
  const workspaceArgs = getCmuxWorkspaceArgs();
3145
- if (activeRequest) {
3153
+ const statusColor = getCmuxStudioStatusColor();
3154
+ if (activeRequest || (pendingStudioCompletionKind && agentBusy)) {
3146
3155
  runCmuxCommand([
3147
3156
  "set-status",
3148
3157
  CMUX_STUDIO_STATUS_KEY,
3149
3158
  "running…",
3150
3159
  "--color",
3151
- "#5ea1ff",
3160
+ statusColor,
3152
3161
  ...workspaceArgs,
3153
3162
  ]);
3154
3163
  return;
@@ -3159,7 +3168,7 @@ export default function (pi: ExtensionAPI) {
3159
3168
  CMUX_STUDIO_STATUS_KEY,
3160
3169
  "compacting…",
3161
3170
  "--color",
3162
- "#5ea1ff",
3171
+ statusColor,
3163
3172
  ...workspaceArgs,
3164
3173
  ]);
3165
3174
  return;
@@ -3261,6 +3270,23 @@ export default function (pi: ExtensionAPI) {
3261
3270
  return "Studio: response ready.";
3262
3271
  };
3263
3272
 
3273
+ const clearPendingStudioCompletion = () => {
3274
+ if (!pendingStudioCompletionKind) return;
3275
+ pendingStudioCompletionKind = null;
3276
+ syncCmuxStudioStatus();
3277
+ };
3278
+
3279
+ const flushPendingStudioCompletionNotification = () => {
3280
+ if (!pendingStudioCompletionKind) return;
3281
+ const kind = pendingStudioCompletionKind;
3282
+ pendingStudioCompletionKind = null;
3283
+ syncCmuxStudioStatus();
3284
+ const message = getStudioRequestCompletionNotification(kind);
3285
+ emitDebugEvent("studio_completion_notification", { kind });
3286
+ notifyStudio(message, "info");
3287
+ notifyStudioTerminal(message, "info");
3288
+ };
3289
+
3264
3290
  const refreshContextUsage = (
3265
3291
  ctx?: { getContextUsage(): { tokens: number | null; contextWindow: number; percent: number | null } | undefined },
3266
3292
  ): StudioContextUsageSnapshot => {
@@ -4392,6 +4418,7 @@ export default function (pi: ExtensionAPI) {
4392
4418
  const json = JSON.stringify(vars);
4393
4419
  if (json !== lastThemeVarsJson) {
4394
4420
  lastThemeVarsJson = json;
4421
+ syncCmuxStudioStatus();
4395
4422
  for (const client of serverState.clients) {
4396
4423
  sendToClient(client, { type: "theme_update", vars });
4397
4424
  }
@@ -4409,6 +4436,7 @@ export default function (pi: ExtensionAPI) {
4409
4436
  const stopServer = async () => {
4410
4437
  if (!serverState) return;
4411
4438
  clearActiveRequest();
4439
+ clearPendingStudioCompletion();
4412
4440
  clearCompactionState();
4413
4441
  closeAllClients(1001, "Server shutting down");
4414
4442
 
@@ -4440,6 +4468,7 @@ export default function (pi: ExtensionAPI) {
4440
4468
  hydrateLatestAssistant(ctx.sessionManager.getBranch());
4441
4469
  clearCompactionState();
4442
4470
  agentBusy = false;
4471
+ clearPendingStudioCompletion();
4443
4472
  refreshRuntimeMetadata({ cwd: ctx.cwd, model: ctx.model });
4444
4473
  refreshContextUsage(ctx);
4445
4474
  emitDebugEvent("session_start", {
@@ -4458,6 +4487,7 @@ export default function (pi: ExtensionAPI) {
4458
4487
  lastCommandCtx = null;
4459
4488
  hydrateLatestAssistant(ctx.sessionManager.getBranch());
4460
4489
  agentBusy = false;
4490
+ clearPendingStudioCompletion();
4461
4491
  refreshRuntimeMetadata({ cwd: ctx.cwd, model: ctx.model });
4462
4492
  refreshContextUsage(ctx);
4463
4493
  emitDebugEvent("session_switch", {
@@ -4618,10 +4648,8 @@ export default function (pi: ExtensionAPI) {
4618
4648
  responseHistory: studioResponseHistory,
4619
4649
  });
4620
4650
  broadcastResponseHistory();
4621
- clearActiveRequest({
4622
- terminalNotify: getStudioRequestCompletionNotification(kind),
4623
- terminalNotifyLevel: "info",
4624
- });
4651
+ pendingStudioCompletionKind = kind;
4652
+ clearActiveRequest();
4625
4653
  return;
4626
4654
  }
4627
4655
 
@@ -4658,6 +4686,7 @@ export default function (pi: ExtensionAPI) {
4658
4686
  activeRequestKind: activeRequest?.kind ?? null,
4659
4687
  suppressedRequestId: suppressedStudioResponse?.requestId ?? null,
4660
4688
  suppressedRequestKind: suppressedStudioResponse?.kind ?? null,
4689
+ pendingCompletionKind: pendingStudioCompletionKind,
4661
4690
  });
4662
4691
  setTerminalActivity("idle");
4663
4692
  if (activeRequest) {
@@ -4668,6 +4697,9 @@ export default function (pi: ExtensionAPI) {
4668
4697
  message: "Request ended without a complete assistant response.",
4669
4698
  });
4670
4699
  clearActiveRequest();
4700
+ clearPendingStudioCompletion();
4701
+ } else {
4702
+ flushPendingStudioCompletionNotification();
4671
4703
  }
4672
4704
  suppressedStudioResponse = null;
4673
4705
  });
@@ -4675,6 +4707,7 @@ export default function (pi: ExtensionAPI) {
4675
4707
  pi.on("session_shutdown", async () => {
4676
4708
  lastCommandCtx = null;
4677
4709
  agentBusy = false;
4710
+ clearPendingStudioCompletion();
4678
4711
  clearCompactionState();
4679
4712
  setTerminalActivity("idle");
4680
4713
  await stopServer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-studio",
3
- "version": "0.5.17",
3
+ "version": "0.5.19",
4
4
  "description": "Browser GUI for structured critique workflows in pi",
5
5
  "type": "module",
6
6
  "license": "MIT",