From cc4299cdeaa7b298c63a6fff59f7caf8d872f5cb Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 7 Jan 2026 03:34:57 +0900 Subject: [PATCH] docs: add background task concurrency configuration guide to all READMEs --- README.ja.md | 34 ++++++++++++++++++++++++++++++++++ README.md | 34 ++++++++++++++++++++++++++++++++++ README.zh-cn.md | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) diff --git a/README.ja.md b/README.ja.md index 9ab4eee..5eb8809 100644 --- a/README.ja.md +++ b/README.ja.md @@ -907,6 +907,40 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま | `planner_enabled` | `true` | `true` の場合、Planner-Sisyphus エージェントを有効化します(OpenCode plan と同じ、SDK 制限により名前変更)。デフォルトで有効です。 | | `replace_plan` | `true` | `true` の場合、デフォルトのプランエージェントをサブエージェントモードに降格させます。`false` に設定すると、Planner-Sisyphus とデフォルトのプランの両方を利用できます。 | +### Background Tasks + +バックグラウンドエージェントタスクの同時実行数を設定します。並列で実行できるバックグラウンドエージェントの数を制御します。 + +```json +{ + "background_task": { + "defaultConcurrency": 5, + "providerConcurrency": { + "anthropic": 3, + "openai": 5, + "google": 10 + }, + "modelConcurrency": { + "anthropic/claude-opus-4-5": 2, + "google/gemini-3-flash": 10 + } + } +} +``` + +| オプション | デフォルト | 説明 | +| --------------------- | ---------- | -------------------------------------------------------------------------------------------------------------- | +| `defaultConcurrency` | - | すべてのプロバイダー/モデルに対するデフォルトの最大同時バックグラウンドタスク数 | +| `providerConcurrency` | - | プロバイダーごとの同時実行制限。キーはプロバイダー名(例:`anthropic`、`openai`、`google`) | +| `modelConcurrency` | - | モデルごとの同時実行制限。キーは完全なモデル名(例:`anthropic/claude-opus-4-5`)。プロバイダー制限より優先されます。 | + +**優先順位**: `modelConcurrency` > `providerConcurrency` > `defaultConcurrency` + +**ユースケース**: +- 高価なモデル(例:Opus)を制限してコストの急増を防ぐ +- 高速で安価なモデル(例:Gemini Flash)により多くの同時タスクを許可する +- プロバイダーレベルの上限を設定してプロバイダーのレートリミットを遵守する + ### Hooks `~/.config/opencode/oh-my-opencode.json` または `.opencode/oh-my-opencode.json` の `disabled_hooks` を通じて特定の内蔵フックを無効化できます: diff --git a/README.md b/README.md index 0ceeb8c..ea5cdaa 100644 --- a/README.md +++ b/README.md @@ -969,6 +969,40 @@ You can also customize Sisyphus agents like other agents: | `planner_enabled` | `true` | When `true`, enables Planner-Sisyphus agent (same as OpenCode plan, renamed due to SDK limitations). Enabled by default. | | `replace_plan` | `true` | When `true`, demotes default plan agent to subagent mode. Set to `false` to keep both Planner-Sisyphus and default plan available. | +### Background Tasks + +Configure concurrency limits for background agent tasks. This controls how many parallel background agents can run simultaneously. + +```json +{ + "background_task": { + "defaultConcurrency": 5, + "providerConcurrency": { + "anthropic": 3, + "openai": 5, + "google": 10 + }, + "modelConcurrency": { + "anthropic/claude-opus-4-5": 2, + "google/gemini-3-flash": 10 + } + } +} +``` + +| Option | Default | Description | +| --------------------- | ------- | -------------------------------------------------------------------------------------------------------------- | +| `defaultConcurrency` | - | Default maximum concurrent background tasks for all providers/models | +| `providerConcurrency` | - | Per-provider concurrency limits. Keys are provider names (e.g., `anthropic`, `openai`, `google`) | +| `modelConcurrency` | - | Per-model concurrency limits. Keys are full model names (e.g., `anthropic/claude-opus-4-5`). Overrides provider limits. | + +**Priority Order**: `modelConcurrency` > `providerConcurrency` > `defaultConcurrency` + +**Use Cases**: +- Limit expensive models (e.g., Opus) to prevent cost spikes +- Allow more concurrent tasks for fast/cheap models (e.g., Gemini Flash) +- Respect provider rate limits by setting provider-level caps + ### Hooks Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`: diff --git a/README.zh-cn.md b/README.zh-cn.md index ba8a811..fbf3a19 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -911,6 +911,40 @@ Sisyphus Agent 也能自定义: | `planner_enabled` | `true` | 设为 `true` 就启用 Planner-Sisyphus Agent(与 OpenCode plan 相同,因 SDK 限制仅改名)。默认启用。 | | `replace_plan` | `true` | 设为 `true` 就把默认计划 Agent 降级为子 Agent 模式。设为 `false` 可以同时保留 Planner-Sisyphus 和默认计划。 | +### Background Tasks(后台任务) + +配置后台 Agent 任务的并发限制。这控制了可以同时运行多少个并行后台 Agent。 + +```json +{ + "background_task": { + "defaultConcurrency": 5, + "providerConcurrency": { + "anthropic": 3, + "openai": 5, + "google": 10 + }, + "modelConcurrency": { + "anthropic/claude-opus-4-5": 2, + "google/gemini-3-flash": 10 + } + } +} +``` + +| 选项 | 默认值 | 说明 | +| --------------------- | ------ | -------------------------------------------------------------------------------------------------------------- | +| `defaultConcurrency` | - | 所有提供商/模型的默认最大并发后台任务数 | +| `providerConcurrency` | - | 按提供商设置并发限制。键是提供商名称(例如:`anthropic`、`openai`、`google`) | +| `modelConcurrency` | - | 按模型设置并发限制。键是完整的模型名称(例如:`anthropic/claude-opus-4-5`)。会覆盖提供商级别的限制。 | + +**优先级顺序**: `modelConcurrency` > `providerConcurrency` > `defaultConcurrency` + +**使用场景**: +- 限制昂贵的模型(如 Opus)以防止成本飙升 +- 允许快速/便宜的模型(如 Gemini Flash)执行更多并发任务 +- 通过设置提供商级别上限来遵守提供商的速率限制 + ### Hooks 在 `~/.config/opencode/oh-my-opencode.json` 或 `.opencode/oh-my-opencode.json` 的 `disabled_hooks` 里关掉你不想要的内置 hook: