Skip to content

feat(embeddedchat): add embedder seams for code-built teams#3655

Merged
Sayt-0 merged 1 commit into
mainfrom
feat/embeddedchat-embedder-seams
Jul 15, 2026
Merged

feat(embeddedchat): add embedder seams for code-built teams#3655
Sayt-0 merged 1 commit into
mainfrom
feat/embeddedchat-embedder-seams

Conversation

@dgageot

@dgageot dgageot commented Jul 15, 2026

Copy link
Copy Markdown
Member

embeddedchat is the intended path for callers that drive an agent from their own UI, but it was unusable for embedders that assemble their agents in code: it demanded a YAML AgentSource and unconditionally pulled docker-agent's full toolset and provider registries through teamloader/defaults — ~77 MB of binary — at link time. Docker Sandboxes' Gordon assistant reimplements the entire wrapper (~440 lines including subtle stream-drain concurrency) purely to avoid that dependency. This change cuts the seams those embedders need.

Config.Team now accepts a pre-built *team.Team; when set, no YAML loading happens, no model switcher is wired, and the registries are never linked. A size check confirms the effect: a Team-only test binary is 42 MB with zero teamloader/toolsets symbols, versus 119 MB with the full registries. The AgentSource path is preserved but now takes its registries through Config.LoadOpts; a new embeddedchat/defaults sub-package re-exports the previous full registries so existing consumers can migrate with a one-line change. Config.InitialSession lets callers seed the first conversation from a restored session store; Restart still begins fresh. ToolActivity gains a streamed Output field and the finished call's Response and structured Result, giving embedded UIs live progress and tool-result parity with the TUI.

Breaking change for AgentSource users: New now returns ErrRegistriesRequired if Config.LoadOpts is empty. Pass defaults.Opts() (from embeddedchat/defaults) for docker-agent's full registries, or supply your own. There are no in-repo consumers of the AgentSource path.

New tests cover a code-built team, an InitialSession resume, and the registries-required error; existing tests are updated to pass defaults.Opts().

Embedders that assemble their agents in code could not use embeddedchat:
it demanded a YAML AgentSource and unconditionally linked docker-agent's
full toolset and provider registries (~77MB of binary) through
teamloader/defaults.

- Config.Team accepts a pre-built team; no YAML loading, no model
  switcher, no registries linked (verified: 42MB vs 119MB test binary).
- The AgentSource path takes its registries via Config.LoadOpts; the
  new embeddedchat/defaults sub-package provides the previous full
  registries, keeping the heavy import out of the core package.
- Config.InitialSession starts from a restored conversation (session
  stores); Restart still begins fresh.
- ToolActivity carries streamed Output and the finished call's
  Response/Result, so embedded UIs can render live progress and tool
  results.

BREAKING: AgentSource users must now pass defaults.Opts() (or their own
registries) via Config.LoadOpts; New returns ErrRegistriesRequired
otherwise.
@dgageot
dgageot requested a review from a team as a code owner July 15, 2026 11:39
@Sayt-0
Sayt-0 merged commit 91db1ca into main Jul 15, 2026
7 checks passed
@Sayt-0
Sayt-0 deleted the feat/embeddedchat-embedder-seams branch July 15, 2026 11:47
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.

2 participants