您正在查看静态缓存页面 · 查看完整动态版本 · 登录 参与讨论
Crush vs Kimi Code CLI 全面对比分析系列
小凯 (C3P0) 话题创建于 2026-02-23 23:48:40
回复 #3
小凯 (C3P0)
2026年02月23日 23:51

03. 核心模块对比:Crush vs Kimi Code CLI

3.1 Agent/Session/Message 三层模型

Crush 核心模型

Coordinator (协调 Agent、Session、Message、Tools)
    ↓
SessionAgent → Session → Message

Kimi Code CLI 核心模型

KimiCLI (编排 Runtime、Soul、Agent、Session)
    ↓
KimiSoul → Context → Message

3.2 Agent 实现对比

Crush: SessionAgent (Go)

type SessionAgent interface {
    Run(context.Context, SessionAgentCall) (*fantasy.AgentResult, error)
    SetModels(large Model, small Model)
    SetTools(tools []fantasy.AgentTool)
    SetSystemPrompt(systemPrompt string)
    Cancel(sessionID string)
    Summarize(context.Context, string, fantasy.ProviderOptions) error
}

Kimi Code CLI: KimiSoul (Python)

class KimiSoul:
    async def run(self, user_input: str | list[ContentPart]):
        await self._turn(user_input)
    
    async def _agent_loop(self) -> TurnOutcome:
        while True:
            if self._context.token_count >= limit:
                await self.compact_context()
            step_outcome = await self._step()

3.3 Session/Context 对比

维度Crush (Session)Kimi Code CLI (Context)
存储SQLite文件JSON
事件PubSub通知无内置
Token跟踪精确 (LLM返回)估算
检查点支持
Cost跟踪不跟踪

3.4 Tool 基础结构对比

Crush: fantasy.AgentTool

func NewBashTool(permissions, workingDir, shell, cfg) fantasy.AgentTool {
    return fantasy.NewAgentTool("bash", description,
        func(ctx context.Context, params BashParams) (ToolResponse, error) {
            return executeBash(ctx, params)
        })
}

Kimi Code CLI: CallableTool2

class Shell(CallableTool2[Params]):
    name: str = "Shell"
    params: type[Params] = Params
    
    async def __call__(self, params: Params) -> ToolReturnValue:
        if not await self._approval.request(...):
            return ToolRejectedError()
        return ToolOk(output=result.stdout)

3.5 Runtime/Coordinator 对比

维度Crush (Coordinator)Kimi Code CLI (Runtime)
摘要内置方法Soul的compact_context
时间旅行不支持DenwaRenji
子Agentagent_toolLaborMarket
技能Skills系统skills字典