Repository navigation
fix(dedup): Allow reasoning tokens and report output limits - #540
Conversation
Raise finding comparison budgets to 8,192 tokens so reasoning models can finish semantic comparisons instead of falling back to exact hashes. Report truncation as output_limit with the model and token diagnostics, and surface failed cross-location consolidation. Cover the three comparison paths and truncation reporting with regression tests based on findings from sentry-python#7780. Refs getsentry/sentry-python#7780 Co-Authored-By: GPT-6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Looks good to me. #531 is what started sending the 512 cap to the provider through the streamFunction wrapper, and a reasoning model can use up that whole budget before it writes any JSON. All three comparison paths now share FINDING_COMPARISON_MAX_TOKENS, and the new Pi tests fail if you put the old 512 back, so the regression is actually covered. I ran pi.test.ts, dedup.test.ts, and extract.test.ts locally and they pass.
One side effect to call out, even though I don't think it blocks: statusFromPiMessage also backs runSkill. Before this change, a length stop during hunk analysis was mapped to provider_error, and analyze.ts turned that into provider_unavailable. Now it becomes sdk_error. That means truncated hunk runs stop counting toward the provider circuit breaker and no longer get the provider-error context or the grouped fingerprint in action error reporting. I think that's the right call, since truncation isn't an outage. But the PR description doesn't mention it, and nothing tests it, so a short test in the analyze path would help lock it in. Also, the "Increase the budget" hint in that error message can't be acted on for skill runs, because runSkill never sets maxTokens. You could show that hint only when maxTokens was passed in.
Raise the output budget for deduplication and cross-location comparisons from 512 to 8,192 tokens so reasoning models can finish their JSON responses. Truncation now reports
output_limitwith the model, finish reason, configured limit, and consumed tokens. Failed cross-location consolidation also emits a warning.#531 started enforcing previously ignored token limits. On sentry-python#7780, Warden 0.50.0 exhausted the 512-token budget and fell back to hash matching, posting repeated findings despite the semantic-matching fix in #536.
Regression tests exercise all three comparison paths through the Pi adapter using captured findings, retain an independent bug, and check truncation diagnostics and telemetry. A local replay using the production auxiliary model completed all seven comparisons at 8,192 tokens; the 512-token control truncated five. The replay absorbed the 14 duplicate initial findings and reduced four follow-up comments to one new IPv6 finding, without posting to GitHub.