fix(desktop): TODO の ScheduleWakeup 再開時のゴリ押し解消と待機UI改善 (#240)#244
fix(desktop): TODO の ScheduleWakeup 再開時のゴリ押し解消と待機UI改善 (#240)#244
Conversation
- scheduler: wakeup 由来の start に `fromScheduledWakeup` フラグを渡す - supervisor: wakeup 再開は「再開」バナーを出さず、元プロンプトを再送せず "(予定時刻になりました。前回の続きから…)" の短い継続だけを渡す - supervisor: wakeup 再開時は `finalAssistantText` を null に戻して UI を クリーンスレートに(次ターンのストリームが前ターンの答えを上書きしない) - UI: `status === "waiting"` のときは「最終回答」ラベルを「待機中」に切替 - UI: 詳細ペインに「待機終了まで」ブロック(MM:SS カウントダウン + 理由)を追加
|
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 44 minutes and 41 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 (3)
✨ 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 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ba5137f6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`isScheduledWakeupContinuation` は `claudeSessionId != null` (= 実際に `--resume` できる状態)も条件に加える。parked turn が `session_id` を取れなかった稀ケースで、継続キューだけの短プロンプトが 空っぽの新規会話に投げられてコンテキストを失う事故を防ぐ。
…chment を daemon へ移植 main 取り込み側で supervisor.ts に加わった以下の機能を、daemon 方式の 新しいアーキテクチャ (supervisor-engine.ts) に再実装する。 #244 ScheduleWakeup 継続 - engine に `wakeupResumeMarkers` を追加し、scheduler からの `fromScheduledWakeup: true` を経由してマーカーを立てる - `start()` option をIPC プロトコル (StartRequest) に追加し、 supervisor.ts (proxy) → client.ts → daemon/index.ts → engine.start の順にフラグを伝搬 - `runSession` がマーカーを消費し「再開」バナー/previous text 再送を スキップして短い継続キューだけを送る - `buildIterationPrompt` に `isScheduledWakeupContinuation` を追加、 claudeSessionId が null のときは iteration-1 フルプロンプトへ フォールバック #245 Claude model/effort - `runClaudeTurn` に `claudeModel`/`claudeEffort` を渡し、 CLAUDE_*_OPTIONS ホワイトリストで検証してから `--model`/`--effort` を spawn に追加(不明値は warn して無視する二重防御) - setup event に「Claude 設定」として選択内容を表示 #250 画像添付 tool_result - `extractToolResultDetails` が image ブロックのみの tool_result も `[画像 N 件]` プレースホルダで emit するよう修正 - `extractAttachmentPaths` を daemon 側にも複製し、iteration 1 の プロンプトに添付ファイルパスを列挙して Read を促す #243 done→resume は trpc-router.ts 側で完結するので追加変更なし
概要
#240 対応。TODO 機能で Claude Code が
ScheduleWakeupでセッションを自己休止したあと、スケジューラーが再開する際の挙動と UI をまとめて改善する。背景
従来の動作には 3 つの課題があった。
runSession()が iteration=1 から再スタートし、buildIterationPrompt()が元の goal.md パス / タイトル / 説明 / ゴールをまるごと再送していた。Claude 側から見ると--resumeで同じ会話が続いているのに、ユーザーメッセージとして同じ指示が 2 回届く状態。加えてストリームに「セッションを再開します。これより下が新しいターンのストリームです。」のバナーが毎回挿入されていた。waiting中でも詳細ペインのラベルが「最終回答」のままで、待機前の応答が最終回答として誤読される。waitingUntilは保持しているのに詳細ペインにカウントダウンがなく、行ラベルの「N分後」しか手がかりがなかった。変更点
バックエンド
TodoSupervisor.start(sessionId, { fromScheduledWakeup })を追加。スケジューラー駆動の再開を識別する内部マーカー (wakeupResumeMarkers) を導入し、runSession()が 1 度だけ消費する設計。TodoScheduler.resumeDueWaitingSessions()はfromScheduledWakeup: trueを付けてstart()を呼ぶ。appendSetupEvent("再開", …)をスキップ。finalAssistantTextを null にクリア(「待機中」→「最終回答」への切替時にフィールドが空になる / 次ターンのストリームが前ターンの答えを上書きしない)。buildIterationPrompt()の専用ブランチで短い継続キュー"(予定時刻になりました。前回の続きから作業を再開してください。)"のみを送る(元プロンプト / システムプロンプト / verify 注記は再送しない)。start()(ユーザー操作・フォローアップ介入)は常に stale なマーカーを先に削除して上書きする。abort()時もマーカーを削除。UI(
TodoManager.tsx)status === "waiting"のとき「最終回答」ラベルを 「待機中」 に差し替え、コピーボタンのタイトルも「待機前の応答をコピー」に変更。waitingReasonを併記。既存の 1 秒 tick (completedAt == null) でライブ更新される。Test plan
ScheduleWakeupを発火させるfinalAssistantTextの保持が効いていることbun run lint/bun run typecheck緑(ローカル確認済み)Closes #240