Files
ragflow/internal/entity/models/longcat.go
jay77721 b97969891c fix(go-models): align LongCat usage handling with DeepSeek and official docs (#17558)
## Summary

- LongCat's token usage did not appear in the server terminal, while
DeepSeek's did — even though both drivers parse and record usage through
the same shared helpers. The gap was a missing debug log in LongCat's
SSE loop, so aggregate usage events were silently processed instead of
printed.
- The official LongCat API docs and live responses from
`api.longcat.chat` return a nested
`usage.completion_tokens_details.reasoning_tokens` breakdown for
thinking mode. The previous flat `LongCatChatResponse.Usage` struct
dropped this field on unmarshal.
- Add test coverage for the nested `reasoning_tokens` field on both the
non-streaming and streaming paths.

Closes #17284
2026-07-31 11:38:32 +08:00

14 KiB