mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-13 19:20:06 +00:00
3bb20f5283
- Raise --max-tokens default from 4096 to 8192. - Auto-raise MaxTokens toward the model's catalog Limit.Output (capped at 32768) when the user hasn't set --max-tokens explicitly and no per-model modelSettings override applied. Prevents silent 4k/8k truncation on models that support 32k-262k output. - Surface FinishReasonLength at turn end: the app now subscribes to TurnEndEvent and renders a system-message banner explaining the current cap, the model's known ceiling, and how to raise it. Previously the TUI swallowed 'length' stops, producing 'ghost' truncations. - Export FinishReason* constants on pkg/kit (Stop, Length, ToolCalls, ContentFilter, Error, Other, Unknown) and fix stale comments that used Anthropic-style strings. - Add Kit.MaxTokens() and Kit.MaxOutputLimit() SDK accessors, backed by Agent.GetMaxTokens() which correctly returns 0 for providers that suppress the param (e.g. Codex OAuth). - Tests: rightSizeMaxTokens covers 7 paths (cap, raise, preserve, explicit flag, nil info, zero limit); handleTurnEnd covers length/ non-length/nil-sendFn and the fallback message formatter. - Docs: update configuration.md, cli/flags.md, and kit-extensions skill to reflect the new default and behavior.