Commit graph

14 commits

Author SHA1 Message Date
Ian
aa2036f229 fix(llm): keep request_log.install(); record tool call timings; both only with STRIX_RUN_RECORD_TIMINGS 2026-10-20 18:26:50 +03:00
Ian
f4a7413963 feat(llm): run.json records every provider request's timing, provider and tokens in llm_requests 2026-10-20 18:26:50 +03:00
alex s
ca20626f84
fix(models): replay malformed tool-call arguments as valid JSON (#1327)
Some checks are pending
CI / python (push) Waiting to run
CI / viewer (push) Waiting to run
CI / package (push) Waiting to run
CI / tui (push) Waiting to run
CI / workflows (push) Waiting to run
CI / ci-passed (push) Blocked by required conditions
* fix(models): replay malformed tool-call arguments as valid JSON

A model that emits a tool call with truncated or otherwise invalid JSON
arguments fails that one call, but the raw string is recorded in the
session. Strict OpenAI-compatible servers (vLLM, SGLang) validate every
assistant tool call in the request, so each later turn is rejected with
"Assistant tool call function.arguments must be valid JSON" and the agent
never recovers. The turn guard now rewrites such arguments on the way out
to a JSON object carrying the original text, alongside the existing
duplicate call-id repair.

* fix(agents): tell the model to re-issue tool calls whose arguments are not valid JSON

A streamed turn that ends mid-tool-call leaves the client with a JSON prefix
as the arguments. Instead of the SDK's generic parse-error result, the tool
wrapper now short-circuits with a clear 'not executed, re-issue with complete
arguments' message so the model recovers in one turn.

* fix(models): treat NaN/Infinity tool-call arguments as malformed

* test(cost): pin model resolution in the provider-prefixed cost test

* fix(models): treat over-nested tool-call arguments as malformed
2026-10-14 18:17:20 -04:00
ian-at-strix
39792c9d61
feat(llm): log the upstream provider behind OpenRouter (#1459)
LiteLLM drops OpenRouter's top-level `provider` from stream chunks (including error chunks) and the `metadata.provider_name` of non-2xx replies, so the request log could not say which provider served or failed an attempt. Record both, plus OpenRouter's `metadata.error_type`, per attempt and emit them as `upstream=` / `upstream_error=` on the llm_request line.
2026-10-07 18:35:12 -07:00
Ian
9b72488c92 docs + unit test fix 2026-09-30 04:46:01 +03:00
Ian
c814f6bf30 Made session IDs optional 2026-09-30 04:46:01 +03:00
Ian
3fbccc6b1d Non-streaming path 2026-09-30 04:46:01 +03:00
Ian
c9aebc6c87 larger default block size 2026-09-30 04:46:01 +03:00
Ian
95fbd8d687 Openrouter sticky sessions for caching, with telemetry 2026-09-30 04:46:01 +03:00
Alex Schapiro
8ca0c4a9b8 Fix LiteLLM cost model resolution 2026-08-12 17:26:00 +03:00
oyasumi
5bb9fe896b
feat(tui): replace Textual with a Go/Bubble Tea interface (#941) 2026-08-03 19:23:07 -07:00
alex s
9de747d135
fix(cost): capture OpenRouter streamed usage.cost (fixes $0 kimi-k3 c… (#929)
* fix(cost): capture OpenRouter streamed usage.cost (fixes $0 kimi-k3 cost)

* refactor(cost): encapsulate streamed OpenRouter cost cache, clear per run

* test(cost): resolve OpenRouter handler via LiteLLM provider pipeline
2026-07-28 23:28:34 -04:00
devin-ai-integration[bot]
f54ecb74f9
fix(report): restore cost tracking for OpenRouter and other LiteLLM-routed models (#801) 2026-07-17 13:38:23 -07:00
Sonai Biswas
c3997cdb35
fix: report cost for streamed OpenRouter calls (#634)
* fix: capture cost for streamed LiteLLM responses

* docs: note LiteLLM streaming metadata callbacks
2026-07-03 00:10:28 -04:00