feat: resolve an omitted thread from the caller's instance - #42
Merged
Conversation
An agent CLI's final turn text had no way to say where it belonged: the 2026-07-14 change removed THREAD_ID and replaced it with per-send explicit targeting, which a wrapped CLI cannot express. An agent instance may now leave thread_id out and have it resolved from its own default_thread_id. Resolution is server-side from the caller identity, so nothing the container carries can misroute a message -- that was the objection to the environment variable, and it still holds. Every other caller type, and an instance with no default, is refused. Deliberately not the thread of whatever woke the instance: in A -> B -> C, B is woken by C's reply on thread BC while owing its answer to A on thread AB. Origin composes because delegation creates sub-threads downward; the trigger does not. Class-on-add now reports the thread doing the adding as a creation circumstance for the class policy to act on. CreateThread settles the thread id before finalizing participants, because creating an instance has to name the thread that is adding it.
This was referenced Aug 1, 2026
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.
Threads half of 2026-08-01-agent-default-thread. Needs agents#71.
An agent CLI's final turn text had no way to say where it belonged — the 2026-07-14 change removed
THREAD_IDand replaced it with per-send explicit targeting, which a wrapped CLI cannot express.SendMessageresolves an omittedthread_idfrom an agent instance'sdefault_thread_id. Server-side, from the caller's own identity, so nothing in the container can misroute a message — that was the objection to the environment variable and it still holds. Every other caller type, and an instance with a NULL default, is refused.CreateThreadsettles the thread id before finalizing participants, because creating an instance has to name the thread adding it, and it has to be the id the thread ends up with. The store takes the id rather than inventing one.Deliberately not the thread of whatever woke the instance: in A → B → C, B is woken by C's reply on thread BC while owing its answer to A on thread AB.