compaction-threshold changedbuild-with-claude/compaction-threshold
Nearest release: v2.1.309, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+10added
Lines−7removed
From line
632
where the diff opens
First seen
21 Sep 2026
this site's first read of the page
Recorded edits17to this page, all time
The whole hunk
from line 632, old and new numbered
/
from line 632
632632 MaxTokens: 4096,
633633 Messages: []anthropic.BetaMessageParam{
634634 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Help me build a Python web scraper")),
635 {Role: anthropic.BetaMessageParamRoleAssistant, Content: []anthropic.BetaContentBlockParamUnion{anthropic.NewBetaTextBlock("I'll help you build a web scraper...")}},
635 {OfAssistant: &anthropic.BetaAssistantMessageParam{Content: []anthropic.BetaContentBlockParamUnion{anthropic.NewBetaTextBlock("I'll help you build a web scraper...")}}},
636636 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Add support for JavaScript-rendered pages")),
637637 },
638638 ContextManagement: anthropic.BetaContextManagementConfigParam{
from line 2604
26042604 "fmt"
26052605 "log"
26062606
2607 "github.com/anthropics/anthropic-sdk-go"
2607 "github.com/anthropics/anthropic-sdk-go/v2"
26082608 )
26092609
26102610 var (
from line 3040
30403040 "fmt"
30413041 "log"
30423042
3043 "github.com/anthropics/anthropic-sdk-go"
3043 "github.com/anthropics/anthropic-sdk-go/v2"
30443044 )
30453045
30463046 var (
from line 3078
30783078 // without thinking blocks; an assistant turn left empty is dropped
30793079 var preserved []anthropic.BetaMessageParam
30803080 for _, message := range messages[max(0, len(messages)-3):] {
3081 if message.OfAssistant == nil {
3082 preserved = append(preserved, message)
3083 continue
3084 }
30813085 var content []anthropic.BetaContentBlockParamUnion
3082 for _, block := range message.Content {
3086 for _, block := range message.OfAssistant.Content {
30833087 if block.OfThinking == nil && block.OfRedactedThinking == nil {
30843088 content = append(content, block)
30853089 }
from line 3091
30873091 if len(content) == 0 {
30883092 continue
30893093 }
3090 message.Content = content
3091 preserved = append(preserved, message)
3094 preserved = append(preserved, anthropic.BetaMessageParam{OfAssistant: &anthropic.BetaAssistantMessageParam{Content: content}})
30923095 }
30933096
30943097 messagesAfterCompaction := []anthropic.BetaMessageParam{
3095 {Role: anthropic.BetaMessageParamRoleAssistant, Content: []anthropic.BetaContentBlockParamUnion{compactionParam}},
3098 {OfAssistant: &anthropic.BetaAssistantMessageParam{Content: []anthropic.BetaContentBlockParamUnion{compactionParam}}},
30963099 }
30973100 messagesAfterCompaction = append(messagesAfterCompaction, preserved...)
30983101
No line in this hunk matches that.