chore: remove all Crush references from comments

Remove mentions of Crush from:
- cache_control.go
- agent.go (2 references)
- content.go
- tool_renderers.go
- lsp-diagnostics.go (2 references)
This commit is contained in:
Ed Zynda
2026-03-29 14:43:51 +03:00
parent d4ec756ce5
commit dfe65ca227
5 changed files with 8 additions and 11 deletions
+2 -4
View File
@@ -2,9 +2,7 @@
// lsp-diagnostics.go — LSP-powered diagnostics for Kit's edit tool.
//
// Starts language servers on demand and surfaces diagnostics after file edits,
// following the same pattern used by Charm's crush editor:
//
// Starts language servers on demand and surfaces diagnostics after file edits:
// 1. After an edit, notify the LSP server of the file change
// 2. Wait for the server to publish fresh diagnostics
// 3. Append diagnostic output to the edit tool's result
@@ -412,7 +410,7 @@ func (c *lspClient) changeFile(absPath, content string) {
}
// waitForDiagnostics polls until the server publishes new diagnostics or
// the timeout elapses. Mirrors crush's WaitForDiagnostics pattern.
// the timeout elapses.
func (c *lspClient) waitForDiagnostics(timeout time.Duration) {
c.diagMu.Lock()
startVersion := c.diagVersion
+2 -2
View File
@@ -100,7 +100,7 @@ type GenerateWithLoopResult struct {
FinalResponse *fantasy.Response
// ConversationMessages contains all messages in the conversation including tool calls and results
ConversationMessages []fantasy.Message
// Messages contains the conversation as custom content blocks (crush-style)
// Messages contains the conversation as custom content blocks
Messages []message.Message
// TotalUsage contains aggregate token usage across all steps
TotalUsage fantasy.Usage
@@ -166,7 +166,7 @@ func NewAgent(ctx context.Context, agentConfig *AgentConfig) (*Agent, error) {
}
if len(allTools) > 0 {
// Apply cache control to last tool (4th block in Crush's 4-block strategy)
// Apply cache control to last tool (4th cache block)
allTools[len(allTools)-1].SetProviderOptions(cacheControlOptions())
agentOpts = append(agentOpts, fantasy.WithTools(allTools...))
}
+1 -1
View File
@@ -16,7 +16,7 @@ func cacheControlOptions() fantasy.ProviderOptions {
}
// applyCacheControlToMessages adds cache control to specific messages.
// Following Crush's strategy (max 4 blocks per Anthropic limit):
// Anthropic allows max 4 cache blocks per request:
// 1. Last system message (if present)
// 2. Last 2 messages in the conversation
func applyCacheControlToMessages(messages []fantasy.Message) []fantasy.Message {
+3 -3
View File
@@ -115,9 +115,9 @@ const (
)
// Message is a single conversation message containing a heterogeneous slice
// of ContentPart blocks. This design (borrowed from crush) enables a single
// assistant message to carry text, reasoning, and multiple tool calls as
// discrete, typed blocks rather than flattening everything into strings.
// of ContentPart blocks. This design enables a single assistant message to
// carry text, reasoning, and multiple tool calls as discrete, typed blocks
// rather than flattening everything into strings.
type Message struct {
ID string `json:"id"`
Role MessageRole `json:"role"`
-1
View File
@@ -634,7 +634,6 @@ func renderBashBody(toolResult string, width int) string {
const lineIndent = " "
// Truncate individual lines to the available width so they never wrap.
// This mirrors Crush's approach: truncate, don't wrap.
lineWidth := max(width-len(lineIndent), 20)
// Account for PaddingLeft(1) on the output/stderr styles
maxLineChars := lineWidth - 1