mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
docs(agents): sharpen provider-source comment per rust create-path trace
Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
co-authored by
Taylor Ho
parent
2ffed51ec5
commit
73eab83ea5
@@ -349,8 +349,8 @@ test("saveAsPersonaTemplateDialogState carries name, prompt, model, and envVars"
|
||||
|
||||
test("saveAsPersonaTemplateDialogState carries the provider id from a provider backend", () => {
|
||||
// A databricks/anthropic agent must promote with its provider, not lose it.
|
||||
// The canonical provider source is backend.id (the create input), not the
|
||||
// derived top-level ManagedAgent.provider snapshot.
|
||||
// backend.id is the canonical source: top-level ManagedAgent.provider is a
|
||||
// persona-pinned snapshot and is null for the persona-less agents this acts on.
|
||||
const state = saveAsPersonaTemplateDialogState(
|
||||
makeAgent({ backend: { type: "provider", id: "databricks", config: {} } }),
|
||||
[],
|
||||
|
||||
@@ -94,12 +94,15 @@ function runtimeIdForAgentCommand(
|
||||
* Extract the LLM provider id from a managed agent's backend so it can carry
|
||||
* into the persona template (a databricks/anthropic agent should promote with
|
||||
* its provider, not lose it). The canonical provider source is the backend
|
||||
* union, not the top-level `provider` field on `ManagedAgent`: that top-level
|
||||
* field is a derived snapshot (output), while a `"provider"` backend carries
|
||||
* the provider id that was the actual create input. A `"local"` backend has
|
||||
* none. Returns `undefined` for local backends — the persona's `provider` is
|
||||
* optional, so an absent provider just carries as unset (auto-detect /
|
||||
* provider-locked runtime).
|
||||
* union, NOT the top-level `provider` field on `ManagedAgent`. That top-level
|
||||
* field is a persona-pinned snapshot: `create_managed_agent` only fills it
|
||||
* from a linked persona's snapshot (commands/agents.rs), so it is `null` for
|
||||
* the persona-less agents this feature acts on (`personaId === null`) — while
|
||||
* `backend` always preserves the real `{ type: "provider"; id }` from the
|
||||
* create input. Reading top-level `provider` here would lose the provider on
|
||||
* exactly those agents. A `"local"` backend has none. Returns `undefined` for
|
||||
* local backends — the persona's `provider` is optional, so an absent provider
|
||||
* just carries as unset (auto-detect / provider-locked runtime).
|
||||
*/
|
||||
function providerForAgentBackend(
|
||||
backend: ManagedAgent["backend"],
|
||||
|
||||
Reference in New Issue
Block a user