@oh-my-pi/pi-coding-agent 16.1.4 → 16.1.5

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.
@@ -2141,8 +2141,9 @@ export class AgentSession {
2141
2141
  return this.#agentId;
2142
2142
  }
2143
2143
 
2144
- /** Advance the tool-choice queue and return the next directive for the upcoming LLM call. */
2145
- nextToolChoice(): ToolChoice | undefined {
2144
+ /** Dequeue the next HARD forced tool choice for the upcoming LLM call, dropping
2145
+ * (and rejecting) one whose named tool is no longer active. */
2146
+ #nextHardToolChoice(): ToolChoice | undefined {
2146
2147
  const choice = this.#toolChoiceQueue.nextToolChoice();
2147
2148
  if (isToolChoiceActive(choice, this.agent.state.tools)) {
2148
2149
  return choice;
@@ -2154,7 +2155,7 @@ export class AgentSession {
2154
2155
  /**
2155
2156
  * The per-turn tool-choice directive for the agent loop's `getToolChoice`. Priority:
2156
2157
  * 1. a HARD forced choice from the queue (genuine forces: user-force, eager-todo, …) —
2157
- * consuming, unchanged from `nextToolChoice`;
2158
+ * consuming (advances the queue generator);
2158
2159
  * 2. else, when a non-forcing preview is pending, a {@link SoftToolRequirement} — a
2159
2160
  * PEEK (advances/pops nothing), so the agent-loop injects the reminder once per head
2160
2161
  * and escalates to a forced `resolve` only if the model declines. A compliant turn
@@ -2162,7 +2163,7 @@ export class AgentSession {
2162
2163
  * 3. else undefined.
2163
2164
  */
2164
2165
  nextToolChoiceDirective(): ToolChoiceDirective | undefined {
2165
- const hard = this.nextToolChoice();
2166
+ const hard = this.#nextHardToolChoice();
2166
2167
  if (hard !== undefined) return hard;
2167
2168
  const head = this.#toolChoiceQueue.peekPendingHead();
2168
2169
  if (head !== undefined) {