@oh-my-pi/pi-coding-agent 15.12.1 → 15.12.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.
@@ -1139,9 +1139,24 @@ export class AgentSession {
1139
1139
  if (this.#promptInFlightCount === 0) {
1140
1140
  this.#releasePowerAssertion();
1141
1141
  this.#flushPendingAgentEnd();
1142
+ this.#drainStrandedQueuedMessages();
1142
1143
  }
1143
1144
  }
1144
1145
 
1146
+ /** A steer/follow-up can land after the agent loop's final queue poll but
1147
+ * before the prompt unwinds: #promptInFlightCount keeps isStreaming true
1148
+ * through post-prompt recovery, so senders (collab guests, skills) still
1149
+ * queue via agent.steer()/followUp() instead of starting a fresh prompt.
1150
+ * Without a drain those messages strand invisibly until the next manual
1151
+ * prompt. Runs when the session settles; the guard makes it a no-op when
1152
+ * the queue was consumed normally or a new turn already started. */
1153
+ #drainStrandedQueuedMessages(): void {
1154
+ if (!this.agent.hasQueuedMessages()) return;
1155
+ this.#scheduleAgentContinue({
1156
+ shouldContinue: () => this.#canAutoContinueForFollowUp() && this.agent.hasQueuedMessages(),
1157
+ });
1158
+ }
1159
+
1145
1160
  #resetInFlight(): void {
1146
1161
  this.#promptInFlightCount = 0;
1147
1162
  this.#releasePowerAssertion();
@@ -5255,6 +5270,14 @@ export class AgentSession {
5255
5270
  } else {
5256
5271
  this.agent.steer(normalizedAppMessage);
5257
5272
  }
5273
+ // The isStreaming check above can be stale: image normalization is
5274
+ // awaited, so the turn may have ended in between, leaving the message
5275
+ // queued on an idle agent. Mirror #queueSteer's idle-path delivery.
5276
+ if (this.#canAutoContinueForFollowUp()) {
5277
+ this.#scheduleAgentContinue({
5278
+ shouldContinue: () => this.#canAutoContinueForFollowUp() && this.agent.hasQueuedMessages(),
5279
+ });
5280
+ }
5258
5281
  return;
5259
5282
  }
5260
5283