Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/opencode/src/cli/cmd/tui/ui/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function init() {
current.onClose?.()
setStore("stack", store.stack.slice(0, -1))
evt.preventDefault()
evt.stopPropagation()
refocus()
}
})
Expand Down
13 changes: 13 additions & 0 deletions packages/opencode/src/session/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ export namespace LLM {

const tools = await resolveTools(input)

// Warn about potential context window issues for local models with tools
// See: https://github.com/anomalyco/opencode/issues/7185
const MINIMUM_CONTEXT_FOR_TOOLS = 16_384
const toolCount = Object.keys(tools).filter((x) => x !== "invalid").length
if (toolCount > 0 && input.model.limit.context > 0 && input.model.limit.context < MINIMUM_CONTEXT_FOR_TOOLS) {
l.warn("low context window for tool calling", {
contextLimit: input.model.limit.context,
minimumRecommended: MINIMUM_CONTEXT_FOR_TOOLS,
toolCount,
hint: "Tool calling may fail with context windows below 16K tokens. For vLLM/Ollama, increase max-model-len or num_ctx.",
})
}

return streamText({
onError(error) {
l.error("stream error", {
Expand Down
Loading