fix(spec-sync): disable adaptive thinking so the LLM PR summary lands - #139
Merged
Merged
Conversation
claude-sonnet-5 runs adaptive thinking when `thinking` is unset. The thinking tokens count against max_tokens and the first content block is a thinking block, so `.content[0].text` came back empty and the "What changed" section was silently dropped. Same failure as the TypeScript side (PR #102, #103); this one just hadn't tripped yet. Turn thinking off, join all text blocks instead of indexing [0], bump the cap 700 -> 1000, and log the response shape on empty. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes unreliable spec-sync PR summaries by disabling adaptive thinking and improving response parsing and diagnostics.
Changes:
- Disables adaptive thinking and increases output budget.
- Joins all text response blocks.
- Adds failure diagnostics.
Comment on lines
+60
to
+62
| printf '%s' "$response" \ | ||
| | jq -c '{error_type: .error?.type, error_message: .error?.message, stop_reason, block_types: [.content[]?.type]}' \ | ||
| 2>/dev/null || echo "response was empty or not JSON (curl failed?)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The spec-sync
## What changedsummary runs the same fragile code that dropped the summary on ade-typescript #102/#103 (No summary produced; keeping the static PR body.). It has not tripped here yet, but it is the identical bug and will on some future diff.Root cause:
claude-sonnet-5runs adaptive thinking when thethinkingfield is unset. The thinking tokens count againstmax_tokens, and the first content block is athinkingblock — so.content[0].textcame back empty, which the script could not distinguish from "no summary".Fix (mirrors ade-typescript#104):
thinking: {type: "disabled"}— no reasoning pass, so the wholemax_tokensbudget goes to text and the first block is text.[.content[]? | select(.type=="text") | .text] | join("")) instead of indexing[0].max_tokens700 → 1000.