feat(acp,buzz-agent): thread model name through NIP-AM kind 44200 emit path#1564
Merged
Conversation
…t path buzz-agent's usage_update notification omitted the effective model id, causing AgentTurnMetricPayload.model to always be null. Wire the model name through the 4-hop chain: - buzz-agent/src/lib.rs: include "model" key in the usage_update JSON, populated from effective_model_str (already in scope). - buzz-acp/src/usage.rs UsageUpdatePayload: add model: Option<String> with #[serde(default)] so goose payloads without the field parse cleanly. - buzz-acp/src/usage.rs TurnUsage: add model: Option<String>; record() now threads payload.model into the pending TurnUsage regardless of delta_reliable (model is turn metadata, not a delta). - buzz-acp/src/pool.rs publish_agent_turn_metric: replace hardcoded model: None with model: usage.model.clone(). Adds two unit tests: - model_threads_from_payload_to_turn_usage: asserts the field flows record() -> pending -> take(). - model_none_when_payload_omits_model_field: asserts goose-parity / fail-soft deserialization when the field is absent from the wire payload. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
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.
Summary
AgentTurnMetricPayload.modelwas alwaysnullbecause buzz-agent'susage_updatenotification never included amodelkey, andpool.rshardcodedmodel: None. This PR wires the effective model name through the full 4-hop chain.Changes
crates/buzz-agent/src/lib.rs— add"model": effective_model_strto theusage_updatenotification JSON.effective_model_stris already resolved in scope (session override → config default).crates/buzz-acp/src/usage.rs— two struct additions:UsageUpdatePayload: addpub model: Option<String>with#[serde(default)]so goose payloads that predate this field parse cleanly asNone(fail-soft / backward compat).TurnUsage: addpub model: Option<String>;record()now threadspayload.modelinto the pendingTurnUsageunconditionally —modelis turn metadata, not a delta, so it must NOT be gated ondelta_reliable.crates/buzz-acp/src/pool.rs— replacemodel: Noneinpublish_agent_turn_metricwithmodel: usage.model.clone().Tests
Two new tests in
usage::tests:model_threads_from_payload_to_turn_usage— asserts the model string flowsrecord() → pending → take().model_none_when_payload_omits_model_field— asserts goose-parity deserialization: payload withoutmodelparses cleanly and producesTurnUsage { model: None }.All existing tests updated for the new struct field (
model: Nonein the 4TurnUsageliterals and 2UsageUpdatePayloadhelpers in the test suite).Scope
Strictly limited to the
modelfield thread. Does not touch cost/pricing (accumulated_cost,cumulative_cost_usd,turn_cost_usd,total_tokens) — that is PR #2, pending the goose-team conversation ongoose-provider-typesdependency.