@turtton/oh-my-openagent 3.12.3-copilot.2 → 3.12.3-copilot.3

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/README.ja.md CHANGED
@@ -25,12 +25,9 @@ OpenCodeの設定ファイルの `"plugin"` 配列にパッケージ名を追加
25
25
 
26
26
  ## 適用パッチ
27
27
  各パッチの説明:
28
- - **001-background-output-block-true**: `background_output`ツールのガイダンスを6つのソースファイルで変更します。upstreamのデフォルトではバックグラウンドタスク完了時に「レスポンスを終了してシステム通知を待つ」ことを推奨しており、各通知が新しいエージェントターンをトリガーしてPremium Requestを消費します。このパッチは代わりに`block=true`で現在のターン内で結果を待つことを推奨し、通知トリガーによる余分なPremium Request消費を回避します。
29
- - 対象ファイル: `constants.ts`, `background-executor.ts`, `background-agent-executor.ts`, `create-background-task.ts`, `dynamic-agent-prompt-builder.ts`, `sisyphus.ts`
28
+ - **001-block-true-waiting**: バックグラウンドタスクの結果取得時に`block=true`の使用を推奨し、不要なPremium Request消費を削減します。upstreamのデフォルトではバックグラウンドタスク完了時に「レスポンスを終了してシステム通知を待つ」ことを推奨しており、各通知が新しいエージェントターンをトリガーしてPremium Requestを消費します。このパッチは代わりに`block=true`で現在のターン内で結果を待つことを推奨し、ランタイム側もそれを適切にサポートするよう変更します: アクティブにポーリング中のタスクを追跡して冗長な通知を抑制(`noReply: true`)、`block=true`のタイムアウト制限を撤廃(無期限待機、`timeout`パラメータはdeprecatedとなり無視されます)、エージェントプロンプトとツール説明のガイダンステキストを全面更新。ポーリングされていないタスクについては、元の通知駆動の`noReply: !allComplete`ロジックが維持されます。
29
+ - 対象ファイル: `src/tools/background-task/constants.ts`, `src/tools/call-omo-agent/background-executor.ts`, `src/tools/call-omo-agent/background-agent-executor.ts`, `src/tools/background-task/create-background-task.ts`, `src/agents/dynamic-agent-prompt-builder.ts`, `src/agents/sisyphus.ts`, `src/tools/background-task/clients.ts`, `src/tools/background-task/types.ts`, `src/features/background-agent/manager.ts`, `src/tools/background-task/create-background-output.ts`
30
30
  - **002-disable-todo-continuation-enforcer**: `todo-continuation-enforcer`フックをデフォルトで無効化します。このフックはTODOリストに基づいて自動的に作業を継続し、意図しない追加のエージェントターン(とPremium Request)をトリガーする場合があります。設定初期化時のデフォルト`disabled_hooks`リストに追加することで無効化しています。
31
- - **003-noreply-true**: バックグラウンドタスク完了通知を常に`noReply: true`に強制します。このパッチがない場合、すべてのバックグラウンドタスクが完了したときに`noReply: false`の通知が不要な追加エージェントターンをトリガーします — `block=true`(パッチ001)による同一ターン内の結果取得で既に結果を受け取っていても発生します。このパッチは通知トリガーによる追加ターンを抑制し、そのターンが消費するPremium Requestを回避します。
32
- - 対象ファイル: `manager.ts`(2箇所)
33
- - **⚠️ 注意**: このパッチ適用後、`block=true`を使用しないエージェントはバックグラウンドタスク完了時に自動再開しなくなります。パッチ001がエージェントプロンプトで`block=true`を推奨することで緩和していますが、一部のエッジケース(例: 長時間タスクでの`block=true`タイムアウト)では手動介入が必要になる場合があります。
34
31
 
35
32
  ## 無効化されたフックの再有効化
36
33
  `todo-continuation-enforcer`フックを再有効化するには、プロジェクトルートに`opencode.json`を作成します:
package/README.md CHANGED
@@ -29,11 +29,9 @@ OpenCode will automatically install and load the plugin on next startup.
29
29
 
30
30
  ## Patches Applied
31
31
 
32
- - **001-background-output-block-true**: Changes `background_output` tool guidance across 6 source files. The upstream default recommends agents "end their response and wait for system notifications" when background tasks complete — each such notification triggers a new agent turn, consuming a premium request. This patch instead recommends `block=true` to wait for results within the current turn, avoiding extra premium request consumption from notification-triggered responses.
33
- - Files affected: `constants.ts`, `background-executor.ts`, `background-agent-executor.ts`, `create-background-task.ts`, `dynamic-agent-prompt-builder.ts`, `sisyphus.ts`
32
+ - **001-block-true-waiting**: Encourages agents to use `block=true` when collecting background task results, reducing unnecessary premium request consumption. The upstream default recommends agents "end their response and wait for system notifications" when background tasks complete — each notification triggers a new agent turn, consuming a premium request. This patch instead recommends `block=true` to wait within the current turn, and makes the runtime support it properly: tracking which tasks are being actively polled to suppress redundant notifications (`noReply: true`), removing the `block=true` timeout limit (now waits indefinitely, with the `timeout` parameter deprecated and ignored), and updating all guidance text across agent prompts and tool descriptions. For tasks not being actively polled, the original notification-driven `noReply: !allComplete` logic is preserved.
33
+ - Files affected: `src/tools/background-task/constants.ts`, `src/tools/call-omo-agent/background-executor.ts`, `src/tools/call-omo-agent/background-agent-executor.ts`, `src/tools/background-task/create-background-task.ts`, `src/agents/dynamic-agent-prompt-builder.ts`, `src/agents/sisyphus.ts`, `src/tools/background-task/clients.ts`, `src/tools/background-task/types.ts`, `src/features/background-agent/manager.ts`, `src/tools/background-task/create-background-output.ts`
34
34
  - **002-disable-todo-continuation-enforcer**: Disables the `todo-continuation-enforcer` hook by default. This hook automatically continues work based on todo items, triggering additional agent turns (and premium requests) that may not be intended. Disabled by adding it to the default `disabled_hooks` list in the config initialization.
35
- - **003-noreply-true**: Intelligently suppresses background task completion notifications when the agent is already waiting via `block=true`. Instead of the previous blanket `noReply: true` approach, this patch tracks which tasks are being actively polled by `background_output(block=true)`. For those tasks, notifications use `noReply: true` to avoid triggering redundant agent turns. For tasks not being actively polled, the original `noReply: !allComplete` logic is preserved, allowing proper notification-driven resumption. Also removes the `block=true` timeout limit (now waits indefinitely) and registers/unregisters blocking state via `BackgroundManager`.
36
- - Files affected: `clients.ts`, `types.ts`, `manager.ts`, `create-background-output.ts`
37
35
 
38
36
  ## Re-enabling Disabled Hooks
39
37
 
@@ -42,6 +42,7 @@ export declare class BackgroundManager {
42
42
  private idleDeferralTimers;
43
43
  private notificationQueueByParent;
44
44
  private blockingTaskRefCounts;
45
+ private wasBlockedTasks;
45
46
  private rootDescendantCounts;
46
47
  private preStartDescendantReservations;
47
48
  private enableParentSessionNotifications;
package/dist/index.js CHANGED
@@ -78791,6 +78791,7 @@ class BackgroundManager {
78791
78791
  idleDeferralTimers = new Map;
78792
78792
  notificationQueueByParent = new Map;
78793
78793
  blockingTaskRefCounts = new Map;
78794
+ wasBlockedTasks = new Set;
78794
78795
  rootDescendantCounts;
78795
78796
  preStartDescendantReservations;
78796
78797
  enableParentSessionNotifications;
@@ -78816,6 +78817,7 @@ class BackgroundManager {
78816
78817
  registerBlockingTask(taskId) {
78817
78818
  const current = this.blockingTaskRefCounts.get(taskId) ?? 0;
78818
78819
  this.blockingTaskRefCounts.set(taskId, current + 1);
78820
+ this.wasBlockedTasks.add(taskId);
78819
78821
  }
78820
78822
  unregisterBlockingTask(taskId) {
78821
78823
  const current = this.blockingTaskRefCounts.get(taskId) ?? 0;
@@ -78826,7 +78828,7 @@ class BackgroundManager {
78826
78828
  }
78827
78829
  }
78828
78830
  isTaskBlocking(taskId) {
78829
- return (this.blockingTaskRefCounts.get(taskId) ?? 0) > 0;
78831
+ return (this.blockingTaskRefCounts.get(taskId) ?? 0) > 0 || this.wasBlockedTasks.has(taskId);
78830
78832
  }
78831
78833
  async assertCanSpawn(parentSessionID) {
78832
78834
  const spawnContext = await resolveSubagentSpawnContext(this.client, parentSessionID);
@@ -79716,6 +79718,7 @@ ${originalText}`;
79716
79718
  }
79717
79719
  this.clearNotificationsForTask(taskId);
79718
79720
  this.tasks.delete(taskId);
79721
+ this.wasBlockedTasks.delete(taskId);
79719
79722
  this.clearTaskHistoryWhenParentTasksGone(task.parentSessionID);
79720
79723
  if (task.sessionID) {
79721
79724
  subagentSessions.delete(task.sessionID);
@@ -79972,7 +79975,9 @@ Use \`background_output(task_id="${task.id}")\` to retrieve this result when rea
79972
79975
  noReply: shouldSuppressReply,
79973
79976
  isBlocking: this.isTaskBlocking(task.id)
79974
79977
  });
79978
+ this.wasBlockedTasks.delete(task.id);
79975
79979
  } catch (error92) {
79980
+ this.wasBlockedTasks.delete(task.id);
79976
79981
  if (isAbortedSessionError(error92)) {
79977
79982
  log("[background-agent] Parent session aborted while sending notification; continuing cleanup:", {
79978
79983
  taskId: task.id,
@@ -79984,6 +79989,7 @@ Use \`background_output(task_id="${task.id}")\` to retrieve this result when rea
79984
79989
  }
79985
79990
  }
79986
79991
  } else {
79992
+ this.wasBlockedTasks.delete(task.id);
79987
79993
  log("[background-agent] Parent session notifications disabled, skipping prompt injection:", {
79988
79994
  taskId: task.id,
79989
79995
  parentSessionID: task.parentSessionID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turtton/oh-my-openagent",
3
- "version": "3.12.3-copilot.2",
3
+ "version": "3.12.3-copilot.3",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools (Copilot-compatible fork)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",