Skip to content

Let the goal evaluator and prompt hooks use the model output limit - #464

Merged
ilovepixelart merged 1 commit into
mainfrom
fix-goal-evaluator-token-cap
Nov 16, 2026
Merged

ilovepixelart merged 1 commit into
mainfrom
fix-goal-evaluator-token-cap

Conversation

@ilovepixelart

Copy link
Copy Markdown
Owner

The `/goal` evaluator and `type: prompt` hooks requested at most 512 output tokens. Both now request the model's own output limit (`model.maxTokens`), which is what Claude Code sends for these calls: they carry no override, so its cap resolves to the model's maximum output.

  • A met goal no longer stays active after a long verdict (`extensions/goal.ts`). The evaluator is told to quote transcript evidence; a reason listing several commands ran past 512 tokens, the reply was cut off mid-JSON (`{"ok": true, "reason": "PR #576 exists and meets each part of the condition.\n\n1. Open, unmerged, ...`), `parseVerdict` rejected it, and the session sat idle with the goal active until the next prompt.
  • Prompt hooks get the same limit (`extensions/hooks/runners.ts`). They share the evaluator's code path in Claude Code and had the same 512 cap, so a long hook verdict could be cut off the same way.

Closes #460

  • `npm run check` passes (Biome, strict tsc, Vitest)
  • Tests cover the change

Both ran with a 512-token output cap. A verdict whose reason quotes the
transcript at length ran past it, the reply was cut off mid-JSON, and
the evaluator reported an unreadable verdict, leaving a met goal active
on an idle session. Claude Code sets no cap on these calls, so the
model's own output limit applies; both now pass model.maxTokens.
@sonarqubecloud

Copy link
Copy Markdown

@ilovepixelart
ilovepixelart merged commit 269aa82 into main Nov 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Goal evaluator verdict truncated mid-JSON leaves a met goal active and the session idle

1 participant