Skip to content

fix(chat): handle dynamic output limits - #167

Merged
actus7 merged 2 commits into
mainfrom
fix/chat-dynamic-output-limits
Jul 29, 2026
Merged

fix(chat): handle dynamic output limits#167
actus7 merged 2 commits into
mainfrom
fix/chat-dynamic-output-limits

Conversation

@actus7

@actus7 actus7 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Resumo

  • usa maxOutputTokens do modelo quando disponível
  • infere limites por família/provider e usa fallback seguro quando desconhecido
  • preserva limites retornados por APIs OpenAI-compatible de modelos
  • injeta max_tokens dinâmico no chat e em /v1 após Smart Routing
  • detecta finish_reason=length e mostra Continuar gerando só quando houve truncamento real

Testes

  • pnpm test -- lib/model-output-limits.test.ts lib/chat-stream.test.ts server/tests/v1-auto-lane-scoring.test.ts server/tests/v1-auto-routing.test.ts server/lib/routing/complexity-scorer.test.ts lib/chat-utils.test.ts
  • pnpm typecheck
  • pnpm lint (passa com warning existente em .remember/tmp/last-ndc.ts)

Copilot AI review requested due to automatic review settings July 29, 2026 15:25
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modelhub Ready Ready Preview, Comment Jul 29, 2026 3:30pm

@github-actions github-actions Bot added frontend Frontend changes backend Backend changes tests Test changes labels Jul 29, 2026
@actus7
actus7 merged commit a309c6e into main Jul 29, 2026
12 checks passed
@actus7
actus7 deleted the fix/chat-dynamic-output-limits branch July 29, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend changes frontend Frontend changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants