Repository navigation
feat(tasks): read task membership and status from pi-durable - #160
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADR 0021 decision 8: task membership, acknowledgements, and status come from pi-durable instead of
log.jsonl.Change
log.jsonlfortaskRootentriesSessionStore.listTasks: conversations owned by the requester, via pi-durable's ownership index (scanConversations({ ownerConversationId }))TaskRecord.input)SessionStore.isTask: the session's conversation has an ownertaskRootwritten on the root's log entryStatus, 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
nullanchor input, so they list with an empty acknowledgement; status is unaffected.Eval (
.workspace/task-eval, same scenarios onmainand this branch)task_statusmain, read by this branchVerification
sleep 90; a top-level "好了嗎?" got the status reply with the current step and no model turn;task_statuslisted it as running; the completion mention was posted in the task thread when it ended.