@narumitw/pi-goal 0.46.0 → 0.48.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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/goal.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-goal",
3
- "version": "0.46.0",
3
+ "version": "0.48.0",
4
4
  "description": "Pi extension for autonomous /goal completion with opt-in experimental ordered queues.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/goal.ts CHANGED
@@ -775,6 +775,9 @@ function registerGoalRuntime(pi: ExtensionAPI, options: GoalOptions = {}) {
775
775
  runtime.markAgentToolAttempted();
776
776
  if (runtime.queueFrozen) {
777
777
  if (!isGoalToolName(event.toolName)) return;
778
+ // Blocking alone feeds an error tool result back to the model. Abort too so
779
+ // stale Goal calls cannot loop while the experimental queue remains frozen.
780
+ abortCurrentTurn(ctx);
778
781
  return {
779
782
  block: true,
780
783
  reason:
@@ -799,6 +802,10 @@ function registerGoalRuntime(pi: ExtensionAPI, options: GoalOptions = {}) {
799
802
  clearStaleGoalToolCallBlock();
800
803
  return;
801
804
  }
805
+ // A blocked tool result would normally trigger another model call. Abort the
806
+ // current turn so a tool-seeking model cannot create an unbounded loop that
807
+ // burns provider quota while the goal is stopped.
808
+ abortCurrentTurn(ctx);
802
809
  return {
803
810
  block: true,
804
811
  reason: "Blocked stale /goal tool call after the goal stopped or was interrupted.",