Skip to content

feat: resolve an omitted thread from the caller's instance - #42

Merged
vitramir merged 1 commit into
mainfrom
feat/agent-default-thread
Aug 1, 2026
Merged

feat: resolve an omitted thread from the caller's instance#42
vitramir merged 1 commit into
mainfrom
feat/agent-default-thread

Conversation

@vitramir

@vitramir vitramir commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

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_ID and replaced it with per-send explicit targeting, which a wrapped CLI cannot express.

  • SendMessage resolves an omitted thread_id from an agent instance's default_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.
  • Class-on-add reports the origin thread 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 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.

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.
@vitramir
vitramir merged commit d137e92 into main Aug 1, 2026
1 check passed
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