Skip to content

feat: agent default thread and final turn message - #71

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

feat: agent default thread and final turn message#71
vitramir merged 1 commit into
mainfrom
feat/agent-default-thread

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

Agents half of 2026-08-01-agent-default-thread. Needs api#168 (merged).

  • agent_instances.default_thread_id — nullable, because an instance whose class asked for no inference legitimately has none. Its untargeted sends get refused rather than guessed at. No foreign key: threads are another service's data.
  • agents.default_thread / agents.final_message — both describe how an agent is written, not any one instance, so they sit on the class. Defaults origin and discard preserve today's behaviour.
  • CreateInstance applies the policy. Both creation paths funnel through it and it already holds the class definition, so Threads reports circumstances in context and this decides what they mean. An explicit default_thread_id bypasses the policy — the policy governs only what the platform infers when nobody said.
  • SetInstanceDefaultThread, guarded by can_manage.

Still to come in other repos: Threads passing context.thread_id on class-on-add and resolving an omitted thread_id, and agynd posting the final text.

An instance had no record of the thread it was created to serve, so the
text an agent CLI produces at the end of a turn had nowhere to go.

agent_instances gains default_thread_id, nullable because an instance
whose class asked for no inference legitimately has none -- its
untargeted sends are refused rather than guessed at. Agents gain the two
policies that decide the field: default_thread, which says what to infer
at creation, and final_message, which says whether the final text is a
deliverable at all.

CreateInstance is where the policy runs. Both creation paths funnel
through it and it already holds the class, so Threads reports the
circumstances in a context object and this decides what they mean. A
caller that names a thread outright bypasses the policy, which governs
only what the platform infers when nobody said; SetInstanceDefaultThread
moves it afterwards on the same reasoning.

The defaults preserve today's behaviour: origin is the only inference
that composes for delegation, and discard keeps agents that already send
explicitly from posting everything twice.
@vitramir
vitramir merged commit b410a93 into main Aug 1, 2026
2 checks 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