Commit Graph

2143 Commits

Author SHA1 Message Date
Filip Kujawa 8c8dfa482f feat(server): surface aggregated usage totals to clients
Source TokenState and the ACP usage updates from the on-the-fly aggregation
(session + sub-agent tree) rather than the stored session record, so clients
see the derived per-message totals including delegated sub-agent spend.
2026-07-02 09:06:01 -07:00
Filip Kujawa 518e5e7ec8 feat(agents): capture per-message usage in the reply loop
Resolve each turn's best-estimate cost (provider-reported when present, else
catalog) once in update_session_metrics and record it to the ledger atomically
with the session totals - for normal turns, auto-compaction, and /compact.
Link sub-agent sessions to their parent so their usage rolls into the parent's
grand total. Attach the turn's usage to its assistant message for display.
2026-07-02 09:06:01 -07:00
Filip Kujawa d7a7fcc52e feat(session): per-message usage ledger with on-the-fly aggregation
Add an append-only usage_ledger table (migration v15) and a persisted
sessions.parent_session_id link. The ledger is decoupled from the messages
table so per-call usage survives conversation rewrites (compaction) and
cancelled turns, and each row records the model that produced it so estimated
costs can be recomputed or broken down per model later.

Session totals are derived by summing the ledger across a session and its
sub-agent descendants (recursive CTE over parent_session_id), with a
per-session fallback to the retained accumulated_* record for sessions that
predate the migration.

record_usage_metrics runs in one atomic transaction: it first reconciles the
ledger with any spend recorded outside it (pre-v15 history, or turns run on a
pre-v15 build after switching branches) via a 'carried_forward' adjustment row
- both builds only ever grow accumulated_*, so the componentwise difference is
exactly the spend the ledger missed - then adds the call's delta to the
accumulated columns in SQL (so concurrent writers can't lose updates) and
appends the ledger row. The derived total and the legacy fallback therefore
converge again after any branch round-trip.
2026-07-02 09:06:01 -07:00
Filip Kujawa 7028d15e02 feat(conversation): add per-message MessageUsage carrier
Add MessageUsage (tokens, cost, cost_source, generation timing) on
MessageMetadata, populated and serialized to clients as groundwork for the
per-message UI, and register it plus CostSource in the OpenAPI schema.
2026-07-02 09:06:01 -07:00
Filip Kujawa 71095b16c7 feat(providers): record provider-reported cost on ProviderUsage
Add optional cost + cost_source (ProviderReported/Estimated) to ProviderUsage
and parse `usage.cost` from OpenRouter and Anthropic-compatible gateways across
the streaming and non-streaming OpenAI and Anthropic paths. Request OpenRouter's
inline cost via `usage: {include: true}`. When no provider cost is present the
cost is filled in downstream from the catalog estimate.

Drop the unused ProviderUsage::combine_with rather than extending it with cost
semantics nothing exercises.
2026-07-02 09:06:01 -07:00
Jasper 79cbb2627d Fail closed on unverifiable update provenance (#10168)
Co-authored-by: Jasper <jasper@spiral.xyz>
2026-07-02 15:09:38 +00:00
github-actions[bot] 402ff562b3 chore(release): bump version to 1.41.0 (minor) (#10198)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lifei Zhou <lifei@squareup.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 12:41:48 +00:00
Jasper a3854aee3d Fix canonical model output paths (#10196) 2026-07-02 11:05:16 +00:00
Jasper ba6fb2b56d Refactor local inference provider crates (#10169) 2026-07-02 08:51:53 +00:00
Jasper bf1a986d5e Allow local file ACP origins (#10194) 2026-07-02 08:37:06 +00:00
Abhijay Jain 410a78983e fix(acp): propagate agent cleanup errors on session delete (#10112)
Signed-off-by: Abhijay Jain <Abhijay007j@gmail.com>
2026-07-02 08:06:41 +00:00
石岳峰 dbc1f88ca7 fix(providers): add claude-sonnet-5 to canonical model registry (#10183)
Co-authored-by: syf2211 <syf2211@users.noreply.github.com>
2026-07-02 06:10:35 +00:00
Lifei Zhou 185b185fb8 fix: increased mcp-app-guest request body limit (#10180) 2026-07-02 04:30:53 +00:00
Lifei Zhou b83b194dad acp migration (ui) : ui connect to acp directly instead of goosed (#10081) 2026-07-02 00:29:29 +00:00
Lifei Zhou 0d4b6924b9 Revert "Bedrock model discovery and validation" (#10176) 2026-07-01 23:39:04 +00:00
Jasper a162a7f778 Improve ACP auth and origin defaults (#9886) 2026-07-01 22:08:46 +00:00
Gellért Stadler 7026e14585 Bedrock model discovery and validation (#9997) 2026-07-01 21:19:28 +00:00
yyy33 9165e2738f fix: tolerate partial Responses output items (#10108) 2026-07-01 19:56:57 +00:00
Kyle E DeFreitas 44869db2d9 fix(databricks): always use OpenAI-compatible "parameters" for tools (#10101) 2026-07-01 19:56:54 +00:00
Osraka 2d47d1feea fix(providers): unescape shell-escaped image paths (#10098) 2026-07-01 19:56:52 +00:00
Adam Dalloul a3b4166d4e Update EmpirioLabs provider display name to EmpirioLabs AI (#10126) 2026-07-01 17:06:38 +00:00
Jack Amadeo b6349b5125 add declarative provider support to goose-providers crate (#9992) 2026-07-01 16:40:49 +00:00
Douwe Osinga f150672e23 test: generic validator for declarative providers (#10010)
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
2026-07-01 03:13:10 +00:00
Douwe Osinga 66ce9a6beb Remove MCP sampling support (#10087)
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
Co-authored-by: Lifei Zhou <lifei@squareup.com>
2026-07-01 01:53:44 +00:00
Douwe Osinga c8971fe5fb Support TLS for ACP serve (#10088)
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
Co-authored-by: Lifei Zhou <lifei@squareup.com>
2026-07-01 00:43:18 +00:00
Lifei Zhou 2f32070975 feat (ui): Migrate dictation local model manager to ACP (#10131) 2026-07-01 00:02:52 +00:00
Lucas Kim e8891b7bb0 fix(bedrock): send inference config (max_tokens, temperature) on Converse (#9889)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
2026-06-30 22:59:40 +00:00
Sunil Kumar 12c3e234f5 feat(providers): support OpenRouter request parameters (#9276)
Signed-off-by: sunilkumarvalmiki <g.sunilkumarvalmiki@gmail.com>
Signed-off-by: Douwe Osinga <douwe@sidewalklabs.com>
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
2026-06-30 22:48:03 +00:00
Jasper d1cc1439ec Migrate local inference model management to ACP (#10124) 2026-06-30 22:40:04 +00:00
Sean Murphy 20966fd057 feat: add --edit session flag to edit conversation before forking (#9799)
Signed-off-by: Sean Murphy <murphysean84@gmail.com>
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
2026-06-30 21:15:52 +00:00
FenjuFu 04da8e8702 feat: add iFlytek Spark and Astron MaaS providers (#9837)
Signed-off-by: FenjuFu <fufenjupku@gmail.com>
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
2026-06-30 21:15:50 +00:00
Max Novich d308b13e75 [codex] Add SessionStart hook parity outside CLI (#9970)
Co-authored-by: Max Novich <mnovich@Maxs-MacBook-Pro.local>
2026-06-30 21:15:46 +00:00
Leo Walker 40bfb137ad feat(providers): add Fireworks AI declarative provider (#9990)
Signed-off-by: Leo Walker <leowalker89@gmail.com>
2026-06-30 21:15:43 +00:00
Kyle E DeFreitas c45f757c9d fix(providers): don't retry deterministically-permanent 400s (thinking-block immutability) (#10005)
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
2026-06-30 21:15:41 +00:00
Rodolfo Olivieri d056c72a2c fix(deps): downgrade pkcs8 to v0.10 to match sec1/pkcs1 v0.7 (#10119)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 21:15:38 +00:00
Lucas Alvares Gomes a90430e8e5 Make OpenAI Responses API store param configurable (#10040)
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
2026-06-30 20:00:12 +00:00
github-actions[bot] f1a97fde83 chore(release): bump version to 1.40.0 (minor) (#10099)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jack Amadeo <jackamadeo@squareup.com>
2026-06-30 18:15:28 +00:00
Jack Amadeo b806204887 move ollama provider into goose-providers (#9986) 2026-06-30 17:28:45 +00:00
Lifei Zhou 2084c43476 feat (acp): exposed available tools in acp schema (#10097) 2026-06-30 05:43:08 +00:00
filip d43c692127 perf(providers): keep turn-context out of the Anthropic prefix cache (#10030) 2026-06-30 05:09:37 +00:00
Lifei Zhou 37e62497d4 feat (acp+): Remove REST onboarding setup paths (#10061) 2026-06-30 00:35:30 +00:00
filip 4778448b49 fix(test): stop flaky unparseable-tool-call test by disabling session naming (#10091) 2026-06-30 00:12:07 +00:00
Lifei Zhou f81a0e2471 chore: Remove legacy MCP-UI proxy support (#10086) 2026-06-29 22:58:40 +00:00
Jack Amadeo fe7f16b727 Remove session_id from provider streaming trait methods (#9984) 2026-06-29 22:04:58 +00:00
vvaswani 84d02d6d47 fix(cli): update help text for --session-id (#10077)
Signed-off-by: Vikram Vaswani <2571660+vvaswani@users.noreply.github.com>
2026-06-29 15:30:27 +00:00
Alex Hancock 2cc1140dc1 task(acp): upgrade SDK and use new HTTP/WS crate (#10082) 2026-06-29 05:27:11 +00:00
lunchboxfortwo a1711e75e2 fix(providers): reject non-object tool-call arguments instead of panicking (#9832)
Signed-off-by: Lunchbox <lunchboxfortwo@gmail.com>
Signed-off-by: Douwe M Osinga <douwe@sidewalklabs.com>
Signed-off-by: Goose <goose@aaif.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
Co-authored-by: Goose <goose@aaif.dev>
Co-authored-by: Michael Neale <michael.neale@gmail.com>
2026-06-29 04:08:19 +00:00
Adam Miller 71280996d4 fix(cli): save /edit prompts to history (#10011)
Co-authored-by: Douwe M Osinga <douwe@sidewalklabs.com>
2026-06-28 16:44:01 +00:00
Lifei Zhou 52291e64a7 feat (acp+): Use ACP permission manager for tool permissions (#10066) 2026-06-28 09:54:51 +00:00
石岳峰 d2687643da fix(schedule): use session.message_count for schedule sessions listing (#10026)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-27 16:24:54 +00:00