The per-video chat (ADR-027, v0.23.0) builds its llm.Client per model with llm.WithMaxTokens(cfg.SummaryMaxTokens) (default 1500) — reusing the
summarizer's completion budget to avoid the same small-context overflow trap
(ADR-022: prompt + max_tokens must fit phi4-mini's 8k window).
Problem
A summary needs only a few hundred tokens, so 1500 is right for it. A chat answer
(especially an explanatory multi-paragraph reply) can plausibly want more, and
1500 may clip it mid-sentence. Chat and summarization are different shapes sharing
one budget knob today.
Proposal
Add TAPIR_CHAT_MAX_TOKENS (own default, e.g. 1024–2048), wired only into the
chat client factory (buildChat, cmd/tapir/processor.go).
Keep the overflow guard in mind: with the transcript truncated to TAPIR_MAX_TRANSCRIPT_CHARS (18000 ≈ ~4.5k tokens) plus the chat budget, the
total must still fit the smallest offered model's context. Document the budget
arithmetic next to the knob.
Scope
Pure config + wiring. No engine change. Low priority — surfaces only on long
answers from the smallest model.
## Context
The per-video chat (ADR-027, v0.23.0) builds its `llm.Client` per model with
`llm.WithMaxTokens(cfg.SummaryMaxTokens)` (default **1500**) — reusing the
summarizer's completion budget to avoid the same small-context overflow trap
(ADR-022: prompt + max_tokens must fit phi4-mini's 8k window).
## Problem
A summary needs only a few hundred tokens, so 1500 is right for it. A chat answer
(especially an explanatory multi-paragraph reply) can plausibly want more, and
1500 may clip it mid-sentence. Chat and summarization are different shapes sharing
one budget knob today.
## Proposal
- Add `TAPIR_CHAT_MAX_TOKENS` (own default, e.g. 1024–2048), wired only into the
chat client factory (`buildChat`, `cmd/tapir/processor.go`).
- Keep the overflow guard in mind: with the transcript truncated to
`TAPIR_MAX_TRANSCRIPT_CHARS` (18000 ≈ ~4.5k tokens) plus the chat budget, the
total must still fit the smallest offered model's context. Document the budget
arithmetic next to the knob.
## Scope
Pure config + wiring. No engine change. Low priority — surfaces only on long
answers from the smallest model.
Source: ADR-027, `internal/adapters/chat`, `cmd/tapir/processor.go#buildChat`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
The per-video chat (ADR-027, v0.23.0) builds its
llm.Clientper model withllm.WithMaxTokens(cfg.SummaryMaxTokens)(default 1500) — reusing thesummarizer's completion budget to avoid the same small-context overflow trap
(ADR-022: prompt + max_tokens must fit phi4-mini's 8k window).
Problem
A summary needs only a few hundred tokens, so 1500 is right for it. A chat answer
(especially an explanatory multi-paragraph reply) can plausibly want more, and
1500 may clip it mid-sentence. Chat and summarization are different shapes sharing
one budget knob today.
Proposal
TAPIR_CHAT_MAX_TOKENS(own default, e.g. 1024–2048), wired only into thechat client factory (
buildChat,cmd/tapir/processor.go).TAPIR_MAX_TRANSCRIPT_CHARS(18000 ≈ ~4.5k tokens) plus the chat budget, thetotal must still fit the smallest offered model's context. Document the budget
arithmetic next to the knob.
Scope
Pure config + wiring. No engine change. Low priority — surfaces only on long
answers from the smallest model.
Source: ADR-027,
internal/adapters/chat,cmd/tapir/processor.go#buildChat.