8000 feat(tasks): read task membership and status from pi-durable by geminixiang · Pull Request #160 · geminixiang/mikan · GitHub
[go: up one dir, main page]

Skip to content

feat(tasks): read task membership and status from pi-durable - #160

Merged
geminixiang merged 1 commit into
mainfrom
feat/task-state-durable
Oct 9, 2026
Merged

geminixiang merged 1 commit into
mainfrom
feat/task-state-durable

Conversation

@geminixiang
Copy link
Copy Markdown
Owner

ADR 0021 decision 8: task membership, acknowledgements, and status come from pi-durable instead of log.jsonl.

Change

Before After
Tasks found by scanning log.jsonl for taskRoot entries SessionStore.listTasks: conversations owned by the requester, via pi-durable's ownership index (scanConversations({ ownerConversationId }))
Acknowledgement read from the root's log entry Stored as the background anchor task's input (TaskRecord.input)
Task thread recognized by the log scan SessionStore.isTask: the session's conversation has an owner
taskRoot written on the root's log entry Not written

Status, the in-thread status reply, the completion mention, and restart resume use the new reads. The current step still comes from the runtime's running state.

Compatibility

  • Task threads from before 1.1.0 were ordinary thread sessions and are no longer recognized as tasks; replies there are ordinary thread messages. All such tasks have finished.
  • Tasks created from 1.1.0 to 1.2.2 have a null anchor input, so they list with an empty acknowledgement; status is unaffected.

Eval (.workspace/task-eval, same scenarios on main and this branch)

Case main this branch
E1 three tasks (completed, stopped, running), task_status 3/3 3/3
E2 after restart 3/3 3/3
E3 status question in a task thread answered without a model call same
E4 after the office log is lost 0/3, thread reply goes to the model 3/3, answered without a model call
E5 task thread from 1.0.x 1/1, answered 0/1, goes to the model (accepted)
E6 thread status reply with a 50 MB log, median of 5 505 ms 142 ms
E7 tasks created by main, read by this branch found, status correct, acknowledgement present found, status correct, acknowledgement empty

Verification

  • New test: tasks and acknowledgements are read from the task record after the office log is deleted.
  • Full gate.
  • Local daemon on a test Slack workspace: started a task running sleep 90; a top-level "好了嗎?" got the status reply with the current step and no model turn; task_status listed it as running; the completion mention was posted in the task thread when it ended.

Slack found DM tasks by scanning log.jsonl for taskRoot entries, and read each acknowledgement from that log. A task's session is a conversation owned by a background anchor task, so pi-durable's ownership index already knows every task. The acknowledgement is now the anchor task's input, SessionStore.listTasks lists a requester's tasks by owner, and SessionStore.isTask recognizes a task thread. Status, the in-thread status reply, the completion mention, and restart resume use them, and taskRoot is no longer written.

Task threads from before 1.1.0 were ordinary thread sessions and are no longer recognized; tasks from 1.1.0 to 1.2.2 list without an acknowledgement. ADR 0021 decision 8.
@geminixiang
geminixiang merged commit 8076a29 into main Oct 9, 2026
3 checks passed
@geminixiang
geminixiang deleted the feat/task-state-durable branch October 9, 2026 13:05
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

0