Skip to content

feat(desktop): Start前のTODOのdescription/goalを編集可能に#197

Merged
MocA-Love merged 3 commits into
mainfrom
fix/186-edit-todo-before-start
Apr 16, 2026
Merged

feat(desktop): Start前のTODOのdescription/goalを編集可能に#197
MocA-Love merged 3 commits into
mainfrom
fix/186-edit-todo-before-start

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

概要

Issue #186 の対応。AgentManager で作成したばかりの自律 TODO について、Start 前は 「やって欲しいこと」 と 「ゴール」 を編集できるようにしたい、という要望。これまでは一度作ってしまうと作り直すしか手段がなかった。

実装

Backend

  • `todoAgent.updateFields` mutation を追加
    • input: `sessionId` / `description?` / `goal?` / `clearGoal?`
    • 許可状態: `queued` / `failed` / `aborted` / `escalated` のみ(実行中セッションは拒否)
    • 更新後に `supervisor.prepareArtifacts` を呼び goal.md を再書き出し。iteration プロンプトは goal.md を読ませる仕組みなので、古い内容が残ると編集が無意味になるため。

Frontend

  • `SessionDetail` の DetailBlock (`やって欲しいこと` / `ゴール`) に `action` 付きで 「編集」 ボタンを追加
  • `canStart && !isRunning` のときだけ表示
  • 編集モードでは Textarea + 保存 / キャンセル。保存で mutation → invalidate。

Test plan

  • 新規 TODO 作成直後、Start 前に description/goal を編集できる
  • 保存後の内容で Start すると Claude がそれを読む
  • 実行中セッションでは編集ボタンが出ない
  • failed/aborted のセッションも編集→再 Start できる

Closes #186

AgentManagerで一度作成した自律TODOの 「やって欲しいこと」 と
「ゴール」 を Start 前に修正できず、作り直しになっていた。

- todoAgent.updateFields mutation を追加。status が queued/
  failed/aborted/escalated のときのみ description/goal の更新を
  許可し、変更後は goal.md も書き直す(次回 Start 時に必ず
  新しい内容が読まれるように)
- SessionDetail に行内編集 UI を追加。canStart && !isRunning の
  セッションでのみ DetailBlock に 「編集」 ボタンが出る

Closes #186
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 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 41 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: 6c579f78-2575-47bc-bab9-08ca3e0be75c

📥 Commits

Reviewing files that changed from the base of the PR and between 58c8e6f and 3b88b83.

📒 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 fix/186-edit-todo-before-start

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9079294c25

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

Comment on lines +558 to +561
const [editingField, setEditingField] = useState<
"description" | "goal" | null
>(null);
const [editDraft, setEditDraft] = useState("");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reset edit state when switching selected session

SessionDetail now stores editingField/editDraft in component state, but those values are never cleared when session.id changes. This component is reused across selections (the file already documents that behavior for streamEvents), so if a user starts editing session A and then clicks session B, the draft from A stays visible and pressing save will update B with stale text. Add a useEffect keyed by session.id (or key the component by id) to clear edit mode and draft on selection changes.

Useful? React with 👍 / 👎.

SessionDetailが再利用されるため、editingField/editDraftが
前のセッションに残ったまま別セッションを選ぶと誤保存の
可能性があった。session.id変更時のresetブロックで一緒に
クリアする。

Refs: Codex review on PR #197
@MocA-Love MocA-Love merged commit 10779b2 into main Apr 16, 2026
6 checks passed
@MocA-Love MocA-Love deleted the fix/186-edit-todo-before-start branch April 16, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant