fix(desktop): TODO の maxConcurrentTasks を尊重しキュー消化する (#220)#224
fix(desktop): TODO の maxConcurrentTasks を尊重しキュー消化する (#220)#224
Conversation
supervisor がシングルスロット (`active: ActiveRun | undefined`) だったため、 設定の `maxConcurrentTasks` が完全に無視され、常に 1 セッションしか走らず 残りは永久キュー待ちになっていた。加えて設定変更時に supervisor へ通知が 飛ばないので、ユーザーが 1→2 に上げても pending のまま動き出さなかった。 - `active` を `Map<string, ActiveRun>` に変更し、複数同時実行を可能に - `start()` をキュー登録 + `drain()` 呼び出しに変更 - 各 runSession の `finally` で slot を解放し `drain()` を再実行 - `handleSettingsChanged()` を追加し、settings.update のミューテーションから呼ぶ - abort() も Map ベースに書き換え、対象セッションだけを停止
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 35 minutes and 38 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Issue #220 の修正。TODO 機能の最大同時実行数設定が実質未実装で、常に 1 セッションずつ順次実行されていた。また設定変更時に supervisor に通知が届かないため、1→2 への引き上げ後も pending タスクが動き出さなかった。
原因
TodoSupervisor.activeがActiveRun | undefinedで、シングルスロット実装だったstart()はif (this.active) { queue.push(); return; }とするだけで、maxConcurrentTasksをどこからも参照していなかったupdateTodoSettings()は JSON を書き換えるだけで、supervisor へ通知する経路がなかった修正内容
apps/desktop/src/main/todo-agent/supervisor.tsactiveをMap<string, ActiveRun>に変更(keyed storage)start()を「キューへ追加してdrain()を呼ぶ」形に変更drain()メソッドを追加。毎回getTodoSettings().maxConcurrentTasksを読み直し、容量が空いていて終端状態でないセッションを順次起動するrunSessionを fire-and-forget にし、finallyでスロット解放 +drain()再実行handleSettingsChanged()を追加。設定変更直後に drain して詰まっていたタスクを即起動するabort()を Map ベースに書き換え、対象セッションだけ停止apps/desktop/src/main/todo-agent/trpc-router.tstodoAgent.settings.updateミューテーション内でupdateTodoSettings後にgetTodoSupervisor().handleSettingsChanged()を呼ぶ動作
active.has() || queue.includes()でガードTest plan
bun run lint通過bun run typecheck通過Closes #220