Skip to content

fix(desktop): done タスクにメッセージ送信で再開できるようにする (#241)#243

Merged
MocA-Love merged 1 commit intomainfrom
respected-marionberry
Apr 16, 2026
Merged

fix(desktop): done タスクにメッセージ送信で再開できるようにする (#241)#243
MocA-Love merged 1 commit intomainfrom
respected-marionberry

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

概要

Issue #241 の対応。完了済み (done) のタスクにメッセージを送信しても何も起きなかった挙動を、過去セッションを自動で再開して続きから対話できるように修正します。

一回最後まで走ったタスク(done)になっているものにメッセージを送信した時、再開できるようにできるか?

変更点

バックエンド (apps/desktop/src/main/todo-agent/trpc-router.ts)

  • start の許可ステータスに done を追加。手動 Start でも再開可能にした
  • sendInput で現在のステータスが terminal (done / failed / aborted / escalated) かつ claudeSessionId が残っているとき、preparing へ遷移させて supervisor.start() を呼ぶようにした
    • これにより「メッセージを送る」だけで自動的に再開される
    • supervisor 側には既に --resume <claudeSessionId> で継続する仕組みがあるので、新規配線は不要

UI (apps/desktop/src/renderer/features/todo-agent/TodoManager/TodoManager.tsx)

  • canStartdone && claudeSessionId != null を追加し、Start ボタンを表示
  • フッターのヒント文に「完了済み/失敗のタスクに送ると、過去のセッションを再開して続きから対話します」を追記

仕組み

  1. ユーザーが done 済みタスクにメッセージ送信
  2. sendInputqueueIntervention でメッセージをバッファ → ステータスを preparing
  3. supervisor.start()drain()runSession()isResumingPastRun = !!claudeSessionId を検出
  4. claude -p --resume <id> で実行され、ターン境界で pendingIntervention がプロンプトに反映される

テスト計画

  • bun run typecheck — 全 26 パッケージ成功
  • bun run lint — clean
  • 手動: done 済みセッションでメッセージ送信 → 自動で preparing → running に遷移し、「再開」イベントが表示されて過去の会話を継続する
  • 手動: done 済みセッションで Start ボタンを押下 → 同様に再開する
  • 手動: running 中のメッセージ送信 / queued の pendingIntervention 溜め込みなど既存動作に影響がないこと

- start 許可リストに `done` を追加し、手動 Start でも再開可能に
- sendInput で done/failed/aborted/escalated かつ claudeSessionId 有のときに
  自動的に preparing へ遷移して supervisor.start を呼び、メッセージ送信だけで
  過去セッションを `--resume` で継続するようにした
- UI: done 済みかつ claudeSessionId 有の場合に Start ボタンを表示
- UI: フッターのヒントに「完了済み/失敗のタスクへ送ると再開される」旨を追記

Closes #241
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 37 minutes and 6 seconds before requesting another review.

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 37 minutes and 6 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3823528e-ea64-43c9-8709-d0fb6ae4777b

📥 Commits

Reviewing files that changed from the base of the PR and between 703b976 and 69a531b.

📒 Files selected for processing (2)
  • apps/desktop/src/main/todo-agent/trpc-router.ts
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/TodoManager.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch respected-marionberry

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@MocA-Love
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ 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".

@MocA-Love MocA-Love self-assigned this Apr 16, 2026
@MocA-Love
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@MocA-Love MocA-Love merged commit 1400cda into main Apr 16, 2026
6 checks passed
@MocA-Love MocA-Love deleted the respected-marionberry branch April 16, 2026 23:59
MocA-Love added a commit that referenced this pull request Apr 17, 2026
…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 側で完結するので追加変更なし
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant