feat(embeddedchat): add embedder seams for code-built teams#3655
Merged
Conversation
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.
Sayt-0
approved these changes
Jul 15, 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.
embeddedchatis 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 YAMLAgentSourceand unconditionally pulled docker-agent's full toolset and provider registries throughteamloader/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.Teamnow 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: aTeam-only test binary is 42 MB with zeroteamloader/toolsetssymbols, versus 119 MB with the full registries. TheAgentSourcepath is preserved but now takes its registries throughConfig.LoadOpts; a newembeddedchat/defaultssub-package re-exports the previous full registries so existing consumers can migrate with a one-line change.Config.InitialSessionlets callers seed the first conversation from a restored session store;Restartstill begins fresh.ToolActivitygains a streamedOutputfield and the finished call'sResponseand structuredResult, giving embedded UIs live progress and tool-result parity with the TUI.Breaking change for
AgentSourceusers:Newnow returnsErrRegistriesRequiredifConfig.LoadOptsis empty. Passdefaults.Opts()(fromembeddedchat/defaults) for docker-agent's full registries, or supply your own. There are no in-repo consumers of theAgentSourcepath.New tests cover a code-built team, an
InitialSessionresume, and the registries-required error; existing tests are updated to passdefaults.Opts().