项目简介
Freebuff 是一款免费编程助手,将专用 AI 智能体与主流模型带入终端、桌面、浏览器和 GitHub 仓库。支持并行智能体、文件查找、代码编辑与运行检查,无需订阅或 API 密钥。项目采用 TypeScript 单体仓库,提供 CLI、桌面、Web、云端和聊天等多种产品形态。
README 预览
# Freebuff\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n**Five free AI products for coding, building, and research.** No subscription, credits, or API key required.\n\n[Freebuff](https://freebuff.com) brings specialized agents and a choice of leading models to your terminal, desktop, browser, and GitHub repositories. Text ads support access to the included models.\n\n## Choose your Freebuff\n\n| Product | What it does | Get started |\n| -------------------- | ----------------------------------- | --------------------------------------------------------------------- |\n| **Freebuff Desktop** | Run parallel agents locally | [Download for macOS, Windows, or Linux](https://freebuff.com/desktop) |\n| **Freebuff CLI** | Code from your terminal | [Install the CLI](https://freebuff.com/cli) |\n| **Freebuff Web** | Build and ship full-stack apps | [Build an app](https://freebuff.com/web) |\n| **Freebuff Cloud** | Run agents on any GitHub repository | [Connect a repository](https://freebuff.com/cloud) |\n| **Freebuff Chat** | Research and think with AI | [Start a chat](https://freebuff.com/chat) |\n\n## Quick start\n\nRun Freebuff in any project from your terminal:\n\n```bash\nnpm install -g freebuff\ncd ~/my-project\nfreebuff\n```\n\nThen describe what you want. Freebuff finds the relevant files, makes changes, and runs the checks that matter for your project.\n\n## Models\n\nFreebuff includes a curated model catalog. The regular picker currently offers:\n\n| Model | Access | Best for |\n| --------------------------- | ----------------------- | ------------------------------------------------------------------ |\n| **GPT-5.6 Luna** |
常见问题 (3)
故障排除如何修复 Linux 上 Freebuff CLI 中出现的 "terminal command broker protocol response was missing" 错误?
此错误通常表示终端命令 broker 进程在写入其协议响应之前就已失败;根本原因通常是 ENOSPC(磁盘已满)或 EACCES(权限被拒绝)。请将 Freebuff CLI 升级到包含 broker stderr 修复的最新版本,然后重新运行该命令,以便显示真正的写入错误。使用 df -h $HOME /tmp 检查可用空间,如果磁盘或临时文件系统已满,请释放空间。验证 Freebuff 配置/缓存目录是否可写,例如使用 ls -ld $HOME/.config/freebuff $HOME/.cache/freebuff /tmp 检查,并执行写入测试,如 touch $HOME/.cache/freebuff/.write-test && rm $HOME/.cache/freebuff/.write-test。如有需要,使用 chown -R $USER:$USER $HOME/.config/freebuff $HOME/.cache/freebuff 修复所有权/权限,然后重启 Freebuff。
故障排除如何修复 SDK 中 OpenRouter 额度被重复计算或虚增的问题?
SDK 错误地将 usage.cost 与 cost_details.upstream_inference_cost 相加。OpenRouter 顶层的 usage.cost 已经包含了上游推理成本,因此将二者相加会产生约两倍于正常费用的扣费。请在 sdk/src/impl/llm.ts 中全部三个额度计算路径(流式 reportCost、非流式 generateText 以及 Responses)里,将求和替换为 Math.max(...):
costOverrideDollars = Math.max(
openrouterUsage.cost ?? 0,
openrouterUsage.costDetails?.upstreamInferenceCost ?? 0,
)
这也能正确处理 BYOK 请求,因为 BYOK 报告的是 cost: 0,而实际支出记录在 upstreamInferenceCost 中。打补丁后请重新构建 SDK;如果 SDK 是作为已安装的依赖被使用的,可以使用 patch-package。该 issue 已因搁置过久(stale)被自动关闭,因此请确认你所安装的版本中已包含此修复。
故障排除为什么 /compact 会清除所有之前的聊天记录,只留下一个空的摘要?
当压缩(compaction)接受空的模型响应,或根据消息内容而非来源(provenance)来识别摘要时,就会发生这种情况。在 packages/agent-runtime/src/run-agent-step.ts 中修复此问题:仅当 fullResponse.trim() 非空时才替换历史记录;否则保留 agentState.messageHistory,记录这次空响应的日志,并让重试重新生成摘要。在 compact-history.ts 和 agents/context-pruner.ts 中,为生成的摘要添加 CONVERSATION_SUMMARY 标记/元数据字段,并使 isConversationSummary 必须验证该来源。仅对包含完整封装结构的消息保留旧版回退逻辑:即包含开始和结束的 <conversation_summary> 标签、摘要标题以及 <historical_memory>。还要在 set-messages.ts 中校验消息,使用户引用的 <conversation_summary> 文本无法成为当前生效的摘要。另一个独立的 resume 问题也可能导致类似的失忆:当 run-state.json 无法读取时,应妥善处理该情况,而不是回退到 sessionState 为空的 RunState。临时规避方法:在模型返回空响应后避免依赖 /compact,并且不要在普通用户消息中粘贴 <conversation_summary> 标记。