diff --git a/examples/extensions/lsp-diagnostics.go b/examples/extensions/lsp-diagnostics.go index abd865a4..f25e34d5 100644 --- a/examples/extensions/lsp-diagnostics.go +++ b/examples/extensions/lsp-diagnostics.go @@ -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 diff --git a/internal/agent/agent.go b/internal/agent/agent.go index 59b6f9e9..28e2295b 100644 --- a/internal/agent/agent.go +++ b/internal/agent/agent.go @@ -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...)) } diff --git a/internal/agent/cache_control.go b/internal/agent/cache_control.go index b1bc51af..0b82ce59 100644 --- a/internal/agent/cache_control.go +++ b/internal/agent/cache_control.go @@ -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 { diff --git a/internal/message/content.go b/internal/message/content.go index 356d8849..b119592e 100644 --- a/internal/message/content.go +++ b/internal/message/content.go @@ -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"` diff --git a/internal/ui/tool_renderers.go b/internal/ui/tool_renderers.go index 498447fb..818bf731 100644 --- a/internal/ui/tool_renderers.go +++ b/internal/ui/tool_renderers.go @@ -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