Skip to content

fix(cli): always link events to a task in start/close#5

Merged
hideack merged 3 commits into
mainfrom
fix/start-close-task-linkage
Apr 12, 2026
Merged

fix(cli): always link events to a task in start/close#5
hideack merged 3 commits into
mainfrom
fix/start-close-task-linkage

Conversation

@hideack

@hideack hideack commented Apr 12, 2026

Copy link
Copy Markdown
Owner

問題

ingest start--task なしで実行すると、後続の note / decision 等のイベントが task_id = NULL のまま記録され、ingest resume に一切表示されなかった。

ingest close--task なしで実行すると task_closed イベントを作るだけで、タスクのステータスが active のまま残り続けていた。

修正

ingest start

  • --task が省略された場合、--summary の値をタイトルとしてタスクを自動生成
  • --summary も省略された場合は Session YYYY-MM-DD HH:MM 形式で生成
  • 常に task_id が付いた状態でイベントが記録される

ingest close

  • アクティブタスクが 1つ → 自動でクローズ(従来どおり)
  • アクティブタスクが 複数 → 一覧を表示し、最後に task_started イベントが記録されたタスクを * でマークしてデフォルト候補として提示。--task <id> の明示指定を要求してエラー終了
Multiple active tasks found. Specify --task <id>:
  OaWn9WSXlVaS99BzZj0Rq  新カラーミーペイメント規約の法務確認
  52OcIasjot34QEfB56jac  MCP(AIコネクト)の利用量を出すクエリの準備 *

* Most recently started (suggested default)
  Run: ingest close --task 52OcIasjot34QEfB56jac

Test plan

  • ingest start --summary "壁打ち" でタスクが自動作成され、後続の noteresume に表示されることを確認
  • ingest start(引数なし)で Session YYYY-MM-DD HH:MM 形式のタスクが作成されることを確認
  • アクティブタスクが1つのとき ingest close でそのままクローズされることを確認
  • アクティブタスクが複数のとき ingest close が候補リスト付きエラーを出すことを確認

🤖 Generated with Claude Code

hideack and others added 3 commits April 12, 2026 13:50
Previously, running `ingest start` without --task left all subsequent
events with task_id=NULL, making them invisible in `ingest resume`.
Similarly, `ingest close` without --task only created an event without
actually closing any task.

- start: always create/find a task; title defaults to --summary or
  a timestamp-based "Session YYYY-MM-DD HH:MM" if both are omitted
- close: when --task is omitted, close the most recently active task
  (same selection logic as `ingest resume`)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When only one active task exists, close it automatically as before.
When multiple active tasks are running in parallel, print the full list
and highlight the most recently started task as the suggested default,
then exit with an error so the user must pass --task <id> explicitly.

Adds getLastStartedActiveTask() to taskService to find the task whose
most recent task_started event is the latest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Falls back to title lookup when the given value does not match any
task ID, so both of these work:
  ingest close --task <id>
  ingest close --task "タスク名"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hideack hideack merged commit a2f8da3 into main Apr 12, 2026
1 check passed
@hideack hideack deleted the fix/start-close-task-linkage branch April 12, 2026 04:59
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