mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
When search results exceed maxTokens limit, now returns partial truncated content instead of discarding the file completely. Changes: - Calculate remaining token budget before breaking - Truncate file content to fit within remaining tokens (if > 100 tokens left) - Append truncation marker to indicate content was cut off - Still add truncation message at end of all results Benefits: - Users get partial data instead of nothing - Better debugging and analysis experience - More useful for AI-powered code analysis tasks - Consistent with expected behavior when limits are reached Example: If file would use 10K tokens but only 2K remain, return first ~8K chars of content + truncation marker instead of dropping it. Signed-off-by: Wayne Sun <gsun@redhat.com> |
||
|---|---|---|
| .. | ||
| backend | ||
| db | ||
| mcp | ||
| schemas | ||
| shared | ||
| web | ||