Repository navigation
Threads: mark events processed on delivery, let the thread complete - #50
Merged
Merged
Conversation
…m done The dispatcher now locks each event and marks it processed as it hands it to a session, and no longer renews locks. Delivered events are context for the thread; the session's `end` tool is what finishes it. The thread prompt drops the "mark it done" steps, and Session.events records what was delivered. Closes #49 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
resolve conflicts |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merged main and resolved the conflicts in |
This branch was previously deployed
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.
Part of #48. Sessions no longer mark events done. The dispatcher marks them processed when it hands them over, and
endis the only signal that a thread is finished.What changed
packages/cli/src/threads/dispatcher.ts).lockAllis nowclaimAll: it locks each event so no other consumer takes it too, then marks it processed with that lock token straight away. If another consumer locked it first, it's skipped, as before.renewLocksis gone, along with the remembered lock tokens it relied on. A running session's new events still stay pending until its run exits, then go in together.packages/cli/prompts/thread.md). Every "mark it done" instruction is removed. A delivery lists event ids and types, and the session reads payloads withloopway events get <inbox> <event> --data.linkandendhaven't changed. The delivery header is nowNew events for this thread:(it no longer says "already locked for you").Session.eventsnow lists every event delivered to the session, not the ones it still holds.--ttlhelp text now describes the short claim lock.Defaults picked
--ttl. It now only sets how long the claim lock lasts, and that lock is released a moment later when the event is marked processed. The flag could be removed in a follow-up, but I left the CLI surface alone for this experiment.processedwithout a token returns 200 for an event someone else already processed, so calling it alone could deliver the same event twice. Locking first keeps the claim exclusive.Tests
Session.events.events done.npm run typecheckandnpm testpass (web 34, cli 28).Deploy steps
None. Events left locked by a dispatcher running the old code will become pending again when their locks expire, and the next tick will deliver them.
Closes #49
🤖 Generated with Claude Code