[{"data":1,"prerenderedAt":1515},["ShallowReactive",2],{"blog-post-/blogs/qwenpaw-acp-ai-programming":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"image":11,"alt":12,"ogImage":11,"tags":13,"published":19,"body":20,"_type":1508,"_id":1509,"_source":1510,"_file":1511,"_stem":1512,"_extension":1513,"sitemap":1514},"/blogs/qwenpaw-acp-ai-programming","blogs",false,"","qwenpaw 接入 ACP 后，我发现了 AI 编程的 5 种新玩法","qwenpaw 接入 ACP 协议后，从一个聊天助手变成了本地 AI 基础设施，支持 OpenCode 连接、多 Agent 协作、跨工具链整合等 5 种新玩法","2026-04-24","/blogs-img/qwenpaw-acp-ai-programming.jpg","qwenpaw 接入 ACP 协议后，AI 编程新玩法",[14,15,16,17,18],"qwenpaw","ACP","AI编程","Agent","本地AI",true,{"type":21,"children":22,"toc":1470},"root",[23,31,41,45,51,64,76,87,92,95,101,106,118,130,205,208,214,220,231,249,299,304,334,339,344,384,392,395,401,406,418,470,475,502,507,515,523,526,532,537,549,557,562,585,588,594,599,610,719,724,735,743,751,754,760,765,777,785,790,820,823,829,835,864,870,1076,1082,1142,1145,1151,1157,1190,1196,1270,1275,1318,1321,1326,1337,1342,1369,1374,1382,1405,1408,1413,1448,1451,1464],{"type":24,"tag":25,"props":26,"children":28},"element","h1",{"id":27},"qwenpaw-接入-acp-后我发现了-ai-编程的-5-种新玩法",[29],{"type":30,"value":8},"text",{"type":24,"tag":32,"props":33,"children":34},"blockquote",{},[35],{"type":24,"tag":36,"props":37,"children":38},"p",{},[39],{"type":30,"value":40},"从\"聊天机器人\"到\"本地 AI 基础设施\"，qwenpaw + ACP 正在改变我们使用 AI 的方式",{"type":24,"tag":42,"props":43,"children":44},"hr",{},[],{"type":24,"tag":46,"props":47,"children":49},"h2",{"id":48},"前言",[50],{"type":30,"value":48},{"type":24,"tag":36,"props":52,"children":53},{},[54,56,62],{"type":30,"value":55},"最近给 qwenpaw 接入了 ",{"type":24,"tag":57,"props":58,"children":59},"strong",{},[60],{"type":30,"value":61},"ACP（Agent Client Protocol）",{"type":30,"value":63}," 支持。",{"type":24,"tag":36,"props":65,"children":66},{},[67,69,74],{"type":30,"value":68},"起初我以为这只是个\"让外部工具能调用 qwenpaw\"的功能。但真正深入使用后，我发现它",{"type":24,"tag":57,"props":70,"children":71},{},[72],{"type":30,"value":73},"彻底打通了 AI 编程的场景边界",{"type":30,"value":75},"。",{"type":24,"tag":36,"props":77,"children":78},{},[79,81,86],{"type":30,"value":80},"以前 qwenpaw 是个\"聊天助手\"，现在它变成了",{"type":24,"tag":57,"props":82,"children":83},{},[84],{"type":30,"value":85},"本地 AI 基础设施",{"type":30,"value":75},{"type":24,"tag":36,"props":88,"children":89},{},[90],{"type":30,"value":91},"今天复盘一下，接入 ACP 后，我发现了哪些有意思的玩法。",{"type":24,"tag":42,"props":93,"children":94},{},[],{"type":24,"tag":46,"props":96,"children":98},{"id":97},"_1-核心概念acp-是什么",[99],{"type":30,"value":100},"1. 核心概念：ACP 是什么？",{"type":24,"tag":36,"props":102,"children":103},{},[104],{"type":30,"value":105},"在说玩法之前，先简单理解一下 ACP。",{"type":24,"tag":36,"props":107,"children":108},{},[109,111,116],{"type":30,"value":110},"ACP 是 Zed 团队提出的 ",{"type":24,"tag":57,"props":112,"children":113},{},[114],{"type":30,"value":115},"Agent Client Protocol",{"type":30,"value":117},"，一套标准化的 JSON-RPC 协议，用于让编辑器、IDE 与 AI Agent 通信。",{"type":24,"tag":36,"props":119,"children":120},{},[121,123,128],{"type":30,"value":122},"qwenpaw 接入 ACP 后，支持了",{"type":24,"tag":57,"props":124,"children":125},{},[126],{"type":30,"value":127},"两种互补模式",{"type":30,"value":129},"：",{"type":24,"tag":131,"props":132,"children":133},"table",{},[134,158],{"type":24,"tag":135,"props":136,"children":137},"thead",{},[138],{"type":24,"tag":139,"props":140,"children":141},"tr",{},[142,148,153],{"type":24,"tag":143,"props":144,"children":145},"th",{},[146],{"type":30,"value":147},"模式",{"type":24,"tag":143,"props":149,"children":150},{},[151],{"type":30,"value":152},"角色",{"type":24,"tag":143,"props":154,"children":155},{},[156],{"type":30,"value":157},"说明",{"type":24,"tag":159,"props":160,"children":161},"tbody",{},[162,184],{"type":24,"tag":139,"props":163,"children":164},{},[165,174,179],{"type":24,"tag":166,"props":167,"children":168},"td",{},[169],{"type":24,"tag":57,"props":170,"children":171},{},[172],{"type":30,"value":173},"ACP Server",{"type":24,"tag":166,"props":175,"children":176},{},[177],{"type":30,"value":178},"qwenpaw 是服务端",{"type":24,"tag":166,"props":180,"children":181},{},[182],{"type":30,"value":183},"外部客户端（OpenCode、Zed、Cursor 等）通过 ACP 协议连接 qwenpaw",{"type":24,"tag":139,"props":185,"children":186},{},[187,195,200],{"type":24,"tag":166,"props":188,"children":189},{},[190],{"type":24,"tag":57,"props":191,"children":192},{},[193],{"type":30,"value":194},"ACP Client",{"type":24,"tag":166,"props":196,"children":197},{},[198],{"type":30,"value":199},"qwenpaw 是客户端",{"type":24,"tag":166,"props":201,"children":202},{},[203],{"type":30,"value":204},"qwenpaw 作为调度中心，连接外部 ACP Runner（如 opencode、qwen_code）",{"type":24,"tag":42,"props":206,"children":207},{},[],{"type":24,"tag":46,"props":209,"children":211},{"id":210},"_2-玩法一opencode-连接-qwenpaw-让-ai-拥有记忆与技能",[212],{"type":30,"value":213},"2. 玩法一：OpenCode 连接 qwenpaw —— 让 AI 拥有记忆与技能",{"type":24,"tag":215,"props":216,"children":218},"h3",{"id":217},"场景",[219],{"type":30,"value":217},{"type":24,"tag":36,"props":221,"children":222},{},[223,225,230],{"type":30,"value":224},"OpenCode 是个优秀的本地 AI 编程客户端，但它本身",{"type":24,"tag":57,"props":226,"children":227},{},[228],{"type":30,"value":229},"没有记忆、没有文件操作能力、没有多步任务编排",{"type":30,"value":75},{"type":24,"tag":36,"props":232,"children":233},{},[234,236,241,243,248],{"type":30,"value":235},"接入 ACP 后，OpenCode 可以作为",{"type":24,"tag":57,"props":237,"children":238},{},[239],{"type":30,"value":240},"前端",{"type":30,"value":242},"，qwenpaw 作为",{"type":24,"tag":57,"props":244,"children":245},{},[246],{"type":30,"value":247},"大脑",{"type":30,"value":129},{"type":24,"tag":250,"props":251,"children":255},"pre",{"code":252,"language":253,"meta":7,"className":254,"style":7},"# OpenCode 通过 ACP 连接 qwenpaw\nopencode -m qwenpaw  # 假设已配置 ACP 端点\n","bash","language-bash shiki shiki-themes dracula",[256],{"type":24,"tag":257,"props":258,"children":259},"code",{"__ignoreMap":7},[260,272],{"type":24,"tag":261,"props":262,"children":265},"span",{"class":263,"line":264},"line",1,[266],{"type":24,"tag":261,"props":267,"children":269},{"style":268},"--shiki-default:#6272A4",[270],{"type":30,"value":271},"# OpenCode 通过 ACP 连接 qwenpaw\n",{"type":24,"tag":261,"props":273,"children":275},{"class":263,"line":274},2,[276,282,288,294],{"type":24,"tag":261,"props":277,"children":279},{"style":278},"--shiki-default:#50FA7B",[280],{"type":30,"value":281},"opencode",{"type":24,"tag":261,"props":283,"children":285},{"style":284},"--shiki-default:#BD93F9",[286],{"type":30,"value":287}," -m",{"type":24,"tag":261,"props":289,"children":291},{"style":290},"--shiki-default:#F1FA8C",[292],{"type":30,"value":293}," qwenpaw",{"type":24,"tag":261,"props":295,"children":296},{"style":268},[297],{"type":30,"value":298},"  # 假设已配置 ACP 端点\n",{"type":24,"tag":215,"props":300,"children":302},{"id":301},"效果",[303],{"type":30,"value":301},{"type":24,"tag":305,"props":306,"children":307},"ul",{},[308,319,329],{"type":24,"tag":309,"props":310,"children":311},"li",{},[312,314],{"type":30,"value":313},"OpenCode 负责",{"type":24,"tag":57,"props":315,"children":316},{},[317],{"type":30,"value":318},"代码编辑、Diff 展示、实时交互",{"type":24,"tag":309,"props":320,"children":321},{},[322,324],{"type":30,"value":323},"qwenpaw 负责",{"type":24,"tag":57,"props":325,"children":326},{},[327],{"type":30,"value":328},"记忆读取、技能调用、多步任务执行",{"type":24,"tag":309,"props":330,"children":331},{},[332],{"type":30,"value":333},"两者各司其职，体验远超单一工具",{"type":24,"tag":215,"props":335,"children":337},{"id":336},"我的实践",[338],{"type":30,"value":336},{"type":24,"tag":36,"props":340,"children":341},{},[342],{"type":30,"value":343},"我在 OpenCode 中让 qwenpaw 帮我：",{"type":24,"tag":345,"props":346,"children":347},"ol",{},[348,361,366,379],{"type":24,"tag":309,"props":349,"children":350},{},[351,353,359],{"type":30,"value":352},"读取 ",{"type":24,"tag":257,"props":354,"children":356},{"className":355},[],[357],{"type":30,"value":358},"MEMORY.md",{"type":30,"value":360}," 中的项目上下文",{"type":24,"tag":309,"props":362,"children":363},{},[364],{"type":30,"value":365},"搜索历史会话中的技术决策",{"type":24,"tag":309,"props":367,"children":368},{},[369,371,377],{"type":30,"value":370},"调用 ",{"type":24,"tag":257,"props":372,"children":374},{"className":373},[],[375],{"type":30,"value":376},"foss3",{"type":30,"value":378}," 技能检查对象存储配置",{"type":24,"tag":309,"props":380,"children":381},{},[382],{"type":30,"value":383},"生成代码并提交到 Git",{"type":24,"tag":36,"props":385,"children":386},{},[387],{"type":24,"tag":57,"props":388,"children":389},{},[390],{"type":30,"value":391},"整个过程在 OpenCode 的 UI 中完成，但背后调用了 qwenpaw 的全部能力。",{"type":24,"tag":42,"props":393,"children":394},{},[],{"type":24,"tag":46,"props":396,"children":398},{"id":397},"_3-玩法二qwenpaw-调度-opencode-让-ai-自己写代码",[399],{"type":30,"value":400},"3. 玩法二：qwenpaw 调度 opencode —— 让 AI 自己写代码",{"type":24,"tag":215,"props":402,"children":404},{"id":403},"场景-1",[405],{"type":30,"value":217},{"type":24,"tag":36,"props":407,"children":408},{},[409,411,416],{"type":30,"value":410},"qwenpaw 作为",{"type":24,"tag":57,"props":412,"children":413},{},[414],{"type":30,"value":415},"任务调度器",{"type":30,"value":417},"，将编程任务委派给 opencode（作为 ACP Runner）：",{"type":24,"tag":250,"props":419,"children":423},{"code":420,"language":421,"meta":7,"className":422,"style":7},"# qwenpaw 内部逻辑（伪代码）\ndef code_task(task: str):\n    runner = ACPRunner(\"opencode\")\n    result = runner.run(task)\n    return result\n","python","language-python shiki shiki-themes dracula",[424],{"type":24,"tag":257,"props":425,"children":426},{"__ignoreMap":7},[427,435,443,452,461],{"type":24,"tag":261,"props":428,"children":429},{"class":263,"line":264},[430],{"type":24,"tag":261,"props":431,"children":432},{},[433],{"type":30,"value":434},"# qwenpaw 内部逻辑（伪代码）\n",{"type":24,"tag":261,"props":436,"children":437},{"class":263,"line":274},[438],{"type":24,"tag":261,"props":439,"children":440},{},[441],{"type":30,"value":442},"def code_task(task: str):\n",{"type":24,"tag":261,"props":444,"children":446},{"class":263,"line":445},3,[447],{"type":24,"tag":261,"props":448,"children":449},{},[450],{"type":30,"value":451},"    runner = ACPRunner(\"opencode\")\n",{"type":24,"tag":261,"props":453,"children":455},{"class":263,"line":454},4,[456],{"type":24,"tag":261,"props":457,"children":458},{},[459],{"type":30,"value":460},"    result = runner.run(task)\n",{"type":24,"tag":261,"props":462,"children":464},{"class":263,"line":463},5,[465],{"type":24,"tag":261,"props":466,"children":467},{},[468],{"type":30,"value":469},"    return result\n",{"type":24,"tag":215,"props":471,"children":473},{"id":472},"效果-1",[474],{"type":30,"value":301},{"type":24,"tag":305,"props":476,"children":477},{},[478,487,497],{"type":24,"tag":309,"props":479,"children":480},{},[481,482],{"type":30,"value":323},{"type":24,"tag":57,"props":483,"children":484},{},[485],{"type":30,"value":486},"理解需求、拆解任务、结果校验",{"type":24,"tag":309,"props":488,"children":489},{},[490,492],{"type":30,"value":491},"opencode 负责",{"type":24,"tag":57,"props":493,"children":494},{},[495],{"type":30,"value":496},"编码、调试、文件修改",{"type":24,"tag":309,"props":498,"children":499},{},[500],{"type":30,"value":501},"形成**\"大脑 + 手脚\"**的协作模式",{"type":24,"tag":215,"props":503,"children":505},{"id":504},"我的实践-1",[506],{"type":30,"value":336},{"type":24,"tag":250,"props":508,"children":510},{"code":509},"用户：帮我把 FOSS3 的 storage 模块重构一下\nqwenpaw：\n  1. 分析代码结构\n  2. 拆解为 3 个子任务\n  3. 分别委托 opencode 执行\n  4. 合并结果，运行测试\n  5. 提交 PR\n",[511],{"type":24,"tag":257,"props":512,"children":513},{"__ignoreMap":7},[514],{"type":30,"value":509},{"type":24,"tag":36,"props":516,"children":517},{},[518],{"type":24,"tag":57,"props":519,"children":520},{},[521],{"type":30,"value":522},"这种\"AI 调度 AI\"的模式，是目前最接近自动化的实现方式。",{"type":24,"tag":42,"props":524,"children":525},{},[],{"type":24,"tag":46,"props":527,"children":529},{"id":528},"_4-玩法三多-agent-协作编程",[530],{"type":30,"value":531},"4. 玩法三：多 Agent 协作编程",{"type":24,"tag":215,"props":533,"children":535},{"id":534},"场景-2",[536],{"type":30,"value":217},{"type":24,"tag":36,"props":538,"children":539},{},[540,542,547],{"type":30,"value":541},"结合 qwenpaw 的",{"type":24,"tag":57,"props":543,"children":544},{},[545],{"type":30,"value":546},"多智能体协作能力",{"type":30,"value":548},"，可以实现复杂的编程工作流：",{"type":24,"tag":250,"props":550,"children":552},{"code":551},"用户：实现一个 S3 兼容的对象存储系统\n    ↓\nqwenpaw（主 Agent）\n    ├─→ foss3_skill（FOSS3 项目专家）\n    │     读取 FOSS3 API 文档，确定接口规范\n    ├─→ code_agent（代码生成）\n    │     根据规范生成 Python/Django 代码\n    ├─→ test_agent（测试验证）\n    │     编写单元测试，运行验证\n    └─→ review_agent（代码审查）\n          检查代码质量，提出改进建议\n",[553],{"type":24,"tag":257,"props":554,"children":555},{"__ignoreMap":7},[556],{"type":30,"value":551},{"type":24,"tag":215,"props":558,"children":560},{"id":559},"效果-2",[561],{"type":30,"value":301},{"type":24,"tag":305,"props":563,"children":564},{},[565,570,575],{"type":24,"tag":309,"props":566,"children":567},{},[568],{"type":30,"value":569},"每个 Agent 专注一个领域",{"type":24,"tag":309,"props":571,"children":572},{},[573],{"type":30,"value":574},"通过 ACP 协议高效通信",{"type":24,"tag":309,"props":576,"children":577},{},[578,580],{"type":30,"value":579},"最终产出",{"type":24,"tag":57,"props":581,"children":582},{},[583],{"type":30,"value":584},"经过验证的、高质量的代码",{"type":24,"tag":42,"props":586,"children":587},{},[],{"type":24,"tag":46,"props":589,"children":591},{"id":590},"_5-玩法四跨工具链整合",[592],{"type":30,"value":593},"5. 玩法四：跨工具链整合",{"type":24,"tag":215,"props":595,"children":597},{"id":596},"场景-3",[598],{"type":30,"value":217},{"type":24,"tag":36,"props":600,"children":601},{},[602,604,609],{"type":30,"value":603},"ACP 协议让 qwenpaw 可以",{"type":24,"tag":57,"props":605,"children":606},{},[607],{"type":30,"value":608},"统一管理多种 AI 工具",{"type":30,"value":129},{"type":24,"tag":131,"props":611,"children":612},{},[613,633],{"type":24,"tag":135,"props":614,"children":615},{},[616],{"type":24,"tag":139,"props":617,"children":618},{},[619,624,628],{"type":24,"tag":143,"props":620,"children":621},{},[622],{"type":30,"value":623},"工具",{"type":24,"tag":143,"props":625,"children":626},{},[627],{"type":30,"value":152},{"type":24,"tag":143,"props":629,"children":630},{},[631],{"type":30,"value":632},"ACP 能力",{"type":24,"tag":159,"props":634,"children":635},{},[636,656,677,698],{"type":24,"tag":139,"props":637,"children":638},{},[639,646,651],{"type":24,"tag":166,"props":640,"children":641},{},[642],{"type":24,"tag":57,"props":643,"children":644},{},[645],{"type":30,"value":281},{"type":24,"tag":166,"props":647,"children":648},{},[649],{"type":30,"value":650},"本地编程",{"type":24,"tag":166,"props":652,"children":653},{},[654],{"type":30,"value":655},"代码生成、文件编辑",{"type":24,"tag":139,"props":657,"children":658},{},[659,667,672],{"type":24,"tag":166,"props":660,"children":661},{},[662],{"type":24,"tag":57,"props":663,"children":664},{},[665],{"type":30,"value":666},"qwen_code",{"type":24,"tag":166,"props":668,"children":669},{},[670],{"type":30,"value":671},"阿里编程助手",{"type":24,"tag":166,"props":673,"children":674},{},[675],{"type":30,"value":676},"代码补全、解释",{"type":24,"tag":139,"props":678,"children":679},{},[680,688,693],{"type":24,"tag":166,"props":681,"children":682},{},[683],{"type":24,"tag":57,"props":684,"children":685},{},[686],{"type":30,"value":687},"Claude Code",{"type":24,"tag":166,"props":689,"children":690},{},[691],{"type":30,"value":692},"Anthropic 编程",{"type":24,"tag":166,"props":694,"children":695},{},[696],{"type":30,"value":697},"高级推理、长上下文",{"type":24,"tag":139,"props":699,"children":700},{},[701,709,714],{"type":24,"tag":166,"props":702,"children":703},{},[704],{"type":24,"tag":57,"props":705,"children":706},{},[707],{"type":30,"value":708},"Codex",{"type":24,"tag":166,"props":710,"children":711},{},[712],{"type":30,"value":713},"OpenAI 编程",{"type":24,"tag":166,"props":715,"children":716},{},[717],{"type":30,"value":718},"通用代码生成",{"type":24,"tag":215,"props":720,"children":722},{"id":721},"效果-3",[723],{"type":30,"value":301},{"type":24,"tag":36,"props":725,"children":726},{},[727,729,734],{"type":30,"value":728},"qwenpaw 可以根据任务类型",{"type":24,"tag":57,"props":730,"children":731},{},[732],{"type":30,"value":733},"自动选择最佳工具",{"type":30,"value":129},{"type":24,"tag":250,"props":736,"children":738},{"code":737},"简单任务 → 本地 opencode（快速、免费）\n复杂推理 → Claude Code（强推理能力）\n代码补全 → qwen_code（阿里模型）\n",[739],{"type":24,"tag":257,"props":740,"children":741},{"__ignoreMap":7},[742],{"type":30,"value":737},{"type":24,"tag":36,"props":744,"children":745},{},[746],{"type":24,"tag":57,"props":747,"children":748},{},[749],{"type":30,"value":750},"这就是\"AI 的 AI\"——qwenpaw 成为 AI 工具的编排层。",{"type":24,"tag":42,"props":752,"children":753},{},[],{"type":24,"tag":46,"props":755,"children":757},{"id":756},"_6-玩法五实时流式交互",[758],{"type":30,"value":759},"6. 玩法五：实时流式交互",{"type":24,"tag":215,"props":761,"children":763},{"id":762},"场景-4",[764],{"type":30,"value":217},{"type":24,"tag":36,"props":766,"children":767},{},[768,770,775],{"type":30,"value":769},"ACP 支持",{"type":24,"tag":57,"props":771,"children":772},{},[773],{"type":30,"value":774},"流式更新",{"type":30,"value":776},"，qwenpaw 可以实时推送中间状态：",{"type":24,"tag":250,"props":778,"children":780},{"code":779},"session_update:\n  - agent_thought_chunk: \"正在分析代码...\"\n  - tool_call: \"读取 foss3-api-docs.md\"\n  - tool_call_update: \"读取完成，共 1200 行\"\n  - agent_message_chunk: \"发现 3 个需要修改的接口...\"\n",[781],{"type":24,"tag":257,"props":782,"children":783},{"__ignoreMap":7},[784],{"type":30,"value":779},{"type":24,"tag":215,"props":786,"children":788},{"id":787},"效果-4",[789],{"type":30,"value":301},{"type":24,"tag":305,"props":791,"children":792},{},[793,803,815],{"type":24,"tag":309,"props":794,"children":795},{},[796,798],{"type":30,"value":797},"用户可以看到",{"type":24,"tag":57,"props":799,"children":800},{},[801],{"type":30,"value":802},"AI 的思考过程",{"type":24,"tag":309,"props":804,"children":805},{},[806,808,813],{"type":30,"value":807},"可以",{"type":24,"tag":57,"props":809,"children":810},{},[811],{"type":30,"value":812},"中途干预",{"type":30,"value":814},"（取消、修改指令）",{"type":24,"tag":309,"props":816,"children":817},{},[818],{"type":30,"value":819},"调试更容易（知道 AI 卡在哪里）",{"type":24,"tag":42,"props":821,"children":822},{},[],{"type":24,"tag":46,"props":824,"children":826},{"id":825},"_7-技术细节我是怎么实现的",[827],{"type":30,"value":828},"7. 技术细节：我是怎么实现的",{"type":24,"tag":215,"props":830,"children":832},{"id":831},"_1-启动-qwenpaw-作为-acp-server",[833],{"type":30,"value":834},"1. 启动 qwenpaw 作为 ACP Server",{"type":24,"tag":250,"props":836,"children":838},{"code":837,"language":253,"meta":7,"className":254,"style":7},"qwenpaw acp --workspace /path/to/workspace\n",[839],{"type":24,"tag":257,"props":840,"children":841},{"__ignoreMap":7},[842],{"type":24,"tag":261,"props":843,"children":844},{"class":263,"line":264},[845,849,854,859],{"type":24,"tag":261,"props":846,"children":847},{"style":278},[848],{"type":30,"value":14},{"type":24,"tag":261,"props":850,"children":851},{"style":290},[852],{"type":30,"value":853}," acp",{"type":24,"tag":261,"props":855,"children":856},{"style":284},[857],{"type":30,"value":858}," --workspace",{"type":24,"tag":261,"props":860,"children":861},{"style":290},[862],{"type":30,"value":863}," /path/to/workspace\n",{"type":24,"tag":215,"props":865,"children":867},{"id":866},"_2-外部客户端连接",[868],{"type":30,"value":869},"2. 外部客户端连接",{"type":24,"tag":250,"props":871,"children":873},{"code":872,"language":421,"meta":7,"className":422,"style":7},"# ACP 客户端示例\nimport json\nimport subprocess\n\nproc = subprocess.Popen(\n    [\"qwenpaw\", \"acp\", \"--workspace\", WORKSPACE],\n    stdin=subprocess.PIPE,\n    stdout=subprocess.PIPE,\n    text=True\n)\n\n# 初始化握手\nresp = rpc(\"initialize\", {\n    \"protocolVersion\": 20250326,  # 注意：必须是整数\n    \"clientInfo\": {\"name\": \"my-client\", \"version\": \"1.0\"}\n})\n\n# 创建会话\nresp = rpc(\"new_session\")\nsession_id = resp[\"result\"][\"sessionId\"]\n\n# 发送 Prompt\nresp = rpc(\"prompt\", {\"text\": \"帮我写个 Django 视图\"})\n",[874],{"type":24,"tag":257,"props":875,"children":876},{"__ignoreMap":7},[877,885,893,901,909,917,926,935,944,953,962,970,979,988,997,1006,1015,1023,1032,1041,1050,1058,1067],{"type":24,"tag":261,"props":878,"children":879},{"class":263,"line":264},[880],{"type":24,"tag":261,"props":881,"children":882},{},[883],{"type":30,"value":884},"# ACP 客户端示例\n",{"type":24,"tag":261,"props":886,"children":887},{"class":263,"line":274},[888],{"type":24,"tag":261,"props":889,"children":890},{},[891],{"type":30,"value":892},"import json\n",{"type":24,"tag":261,"props":894,"children":895},{"class":263,"line":445},[896],{"type":24,"tag":261,"props":897,"children":898},{},[899],{"type":30,"value":900},"import subprocess\n",{"type":24,"tag":261,"props":902,"children":903},{"class":263,"line":454},[904],{"type":24,"tag":261,"props":905,"children":906},{"emptyLinePlaceholder":19},[907],{"type":30,"value":908},"\n",{"type":24,"tag":261,"props":910,"children":911},{"class":263,"line":463},[912],{"type":24,"tag":261,"props":913,"children":914},{},[915],{"type":30,"value":916},"proc = subprocess.Popen(\n",{"type":24,"tag":261,"props":918,"children":920},{"class":263,"line":919},6,[921],{"type":24,"tag":261,"props":922,"children":923},{},[924],{"type":30,"value":925},"    [\"qwenpaw\", \"acp\", \"--workspace\", WORKSPACE],\n",{"type":24,"tag":261,"props":927,"children":929},{"class":263,"line":928},7,[930],{"type":24,"tag":261,"props":931,"children":932},{},[933],{"type":30,"value":934},"    stdin=subprocess.PIPE,\n",{"type":24,"tag":261,"props":936,"children":938},{"class":263,"line":937},8,[939],{"type":24,"tag":261,"props":940,"children":941},{},[942],{"type":30,"value":943},"    stdout=subprocess.PIPE,\n",{"type":24,"tag":261,"props":945,"children":947},{"class":263,"line":946},9,[948],{"type":24,"tag":261,"props":949,"children":950},{},[951],{"type":30,"value":952},"    text=True\n",{"type":24,"tag":261,"props":954,"children":956},{"class":263,"line":955},10,[957],{"type":24,"tag":261,"props":958,"children":959},{},[960],{"type":30,"value":961},")\n",{"type":24,"tag":261,"props":963,"children":965},{"class":263,"line":964},11,[966],{"type":24,"tag":261,"props":967,"children":968},{"emptyLinePlaceholder":19},[969],{"type":30,"value":908},{"type":24,"tag":261,"props":971,"children":973},{"class":263,"line":972},12,[974],{"type":24,"tag":261,"props":975,"children":976},{},[977],{"type":30,"value":978},"# 初始化握手\n",{"type":24,"tag":261,"props":980,"children":982},{"class":263,"line":981},13,[983],{"type":24,"tag":261,"props":984,"children":985},{},[986],{"type":30,"value":987},"resp = rpc(\"initialize\", {\n",{"type":24,"tag":261,"props":989,"children":991},{"class":263,"line":990},14,[992],{"type":24,"tag":261,"props":993,"children":994},{},[995],{"type":30,"value":996},"    \"protocolVersion\": 20250326,  # 注意：必须是整数\n",{"type":24,"tag":261,"props":998,"children":1000},{"class":263,"line":999},15,[1001],{"type":24,"tag":261,"props":1002,"children":1003},{},[1004],{"type":30,"value":1005},"    \"clientInfo\": {\"name\": \"my-client\", \"version\": \"1.0\"}\n",{"type":24,"tag":261,"props":1007,"children":1009},{"class":263,"line":1008},16,[1010],{"type":24,"tag":261,"props":1011,"children":1012},{},[1013],{"type":30,"value":1014},"})\n",{"type":24,"tag":261,"props":1016,"children":1018},{"class":263,"line":1017},17,[1019],{"type":24,"tag":261,"props":1020,"children":1021},{"emptyLinePlaceholder":19},[1022],{"type":30,"value":908},{"type":24,"tag":261,"props":1024,"children":1026},{"class":263,"line":1025},18,[1027],{"type":24,"tag":261,"props":1028,"children":1029},{},[1030],{"type":30,"value":1031},"# 创建会话\n",{"type":24,"tag":261,"props":1033,"children":1035},{"class":263,"line":1034},19,[1036],{"type":24,"tag":261,"props":1037,"children":1038},{},[1039],{"type":30,"value":1040},"resp = rpc(\"new_session\")\n",{"type":24,"tag":261,"props":1042,"children":1044},{"class":263,"line":1043},20,[1045],{"type":24,"tag":261,"props":1046,"children":1047},{},[1048],{"type":30,"value":1049},"session_id = resp[\"result\"][\"sessionId\"]\n",{"type":24,"tag":261,"props":1051,"children":1053},{"class":263,"line":1052},21,[1054],{"type":24,"tag":261,"props":1055,"children":1056},{"emptyLinePlaceholder":19},[1057],{"type":30,"value":908},{"type":24,"tag":261,"props":1059,"children":1061},{"class":263,"line":1060},22,[1062],{"type":24,"tag":261,"props":1063,"children":1064},{},[1065],{"type":30,"value":1066},"# 发送 Prompt\n",{"type":24,"tag":261,"props":1068,"children":1070},{"class":263,"line":1069},23,[1071],{"type":24,"tag":261,"props":1072,"children":1073},{},[1074],{"type":30,"value":1075},"resp = rpc(\"prompt\", {\"text\": \"帮我写个 Django 视图\"})\n",{"type":24,"tag":215,"props":1077,"children":1079},{"id":1078},"_3-关键发现",[1080],{"type":30,"value":1081},"3. 关键发现",{"type":24,"tag":305,"props":1083,"children":1084},{},[1085,1103,1129],{"type":24,"tag":309,"props":1086,"children":1087},{},[1088,1094,1096,1101],{"type":24,"tag":257,"props":1089,"children":1091},{"className":1090},[],[1092],{"type":30,"value":1093},"protocolVersion",{"type":30,"value":1095}," 必须是",{"type":24,"tag":57,"props":1097,"children":1098},{},[1099],{"type":30,"value":1100},"整数",{"type":30,"value":1102},"，不是字符串",{"type":24,"tag":309,"props":1104,"children":1105},{},[1106,1108,1114,1116,1122,1123],{"type":30,"value":1107},"会话生命周期：",{"type":24,"tag":257,"props":1109,"children":1111},{"className":1110},[],[1112],{"type":30,"value":1113},"new_session",{"type":30,"value":1115}," → ",{"type":24,"tag":257,"props":1117,"children":1119},{"className":1118},[],[1120],{"type":30,"value":1121},"prompt",{"type":30,"value":1115},{"type":24,"tag":257,"props":1124,"children":1126},{"className":1125},[],[1127],{"type":30,"value":1128},"close_session",{"type":24,"tag":309,"props":1130,"children":1131},{},[1132,1134,1140],{"type":30,"value":1133},"流式更新通过 ",{"type":24,"tag":257,"props":1135,"children":1137},{"className":1136},[],[1138],{"type":30,"value":1139},"session_update",{"type":30,"value":1141}," 事件推送",{"type":24,"tag":42,"props":1143,"children":1144},{},[],{"type":24,"tag":46,"props":1146,"children":1148},{"id":1147},"_8-我的思考",[1149],{"type":30,"value":1150},"8. 我的思考",{"type":24,"tag":215,"props":1152,"children":1154},{"id":1153},"acp-的价值",[1155],{"type":30,"value":1156},"ACP 的价值",{"type":24,"tag":345,"props":1158,"children":1159},{},[1160,1170,1180],{"type":24,"tag":309,"props":1161,"children":1162},{},[1163,1168],{"type":24,"tag":57,"props":1164,"children":1165},{},[1166],{"type":30,"value":1167},"标准化",{"type":30,"value":1169},"：统一了 AI 工具的通信协议，不再需要为每个工具写适配器",{"type":24,"tag":309,"props":1171,"children":1172},{},[1173,1178],{"type":24,"tag":57,"props":1174,"children":1175},{},[1176],{"type":30,"value":1177},"可组合",{"type":30,"value":1179},"：不同工具可以像乐高一样拼装",{"type":24,"tag":309,"props":1181,"children":1182},{},[1183,1188],{"type":24,"tag":57,"props":1184,"children":1185},{},[1186],{"type":30,"value":1187},"可扩展",{"type":30,"value":1189},"：新工具只需实现 ACP 协议即可接入生态",{"type":24,"tag":215,"props":1191,"children":1193},{"id":1192},"qwenpaw-的定位变化",[1194],{"type":30,"value":1195},"qwenpaw 的定位变化",{"type":24,"tag":131,"props":1197,"children":1198},{},[1199,1215],{"type":24,"tag":135,"props":1200,"children":1201},{},[1202],{"type":24,"tag":139,"props":1203,"children":1204},{},[1205,1210],{"type":24,"tag":143,"props":1206,"children":1207},{},[1208],{"type":30,"value":1209},"之前",{"type":24,"tag":143,"props":1211,"children":1212},{},[1213],{"type":30,"value":1214},"之后",{"type":24,"tag":159,"props":1216,"children":1217},{},[1218,1231,1244,1257],{"type":24,"tag":139,"props":1219,"children":1220},{},[1221,1226],{"type":24,"tag":166,"props":1222,"children":1223},{},[1224],{"type":30,"value":1225},"聊天机器人",{"type":24,"tag":166,"props":1227,"children":1228},{},[1229],{"type":30,"value":1230},"AI 基础设施",{"type":24,"tag":139,"props":1232,"children":1233},{},[1234,1239],{"type":24,"tag":166,"props":1235,"children":1236},{},[1237],{"type":30,"value":1238},"被动响应",{"type":24,"tag":166,"props":1240,"children":1241},{},[1242],{"type":30,"value":1243},"主动调度",{"type":24,"tag":139,"props":1245,"children":1246},{},[1247,1252],{"type":24,"tag":166,"props":1248,"children":1249},{},[1250],{"type":30,"value":1251},"单一模型",{"type":24,"tag":166,"props":1253,"children":1254},{},[1255],{"type":30,"value":1256},"多模型编排",{"type":24,"tag":139,"props":1258,"children":1259},{},[1260,1265],{"type":24,"tag":166,"props":1261,"children":1262},{},[1263],{"type":30,"value":1264},"独立工作",{"type":24,"tag":166,"props":1266,"children":1267},{},[1268],{"type":30,"value":1269},"生态节点",{"type":24,"tag":215,"props":1271,"children":1273},{"id":1272},"未来展望",[1274],{"type":30,"value":1272},{"type":24,"tag":305,"props":1276,"children":1277},{},[1278,1288,1298,1308],{"type":24,"tag":309,"props":1279,"children":1280},{},[1281,1286],{"type":24,"tag":57,"props":1282,"children":1283},{},[1284],{"type":30,"value":1285},"更多编辑器支持",{"type":30,"value":1287},"：Zed、VS Code、Neovim 等",{"type":24,"tag":309,"props":1289,"children":1290},{},[1291,1296],{"type":24,"tag":57,"props":1292,"children":1293},{},[1294],{"type":30,"value":1295},"更多 AI 工具接入",{"type":30,"value":1297},"：Cursor、Windsurf、Continue 等",{"type":24,"tag":309,"props":1299,"children":1300},{},[1301,1306],{"type":24,"tag":57,"props":1302,"children":1303},{},[1304],{"type":30,"value":1305},"云端协同",{"type":30,"value":1307},"：ACP over HTTP/WebSocket，实现远程协作",{"type":24,"tag":309,"props":1309,"children":1310},{},[1311,1316],{"type":24,"tag":57,"props":1312,"children":1313},{},[1314],{"type":30,"value":1315},"企业级场景",{"type":30,"value":1317},"：内部 AI 开发平台的核心协议",{"type":24,"tag":42,"props":1319,"children":1320},{},[],{"type":24,"tag":46,"props":1322,"children":1324},{"id":1323},"总结",[1325],{"type":30,"value":1323},{"type":24,"tag":36,"props":1327,"children":1328},{},[1329,1331,1336],{"type":30,"value":1330},"qwenpaw 接入 ACP 后，",{"type":24,"tag":57,"props":1332,"children":1333},{},[1334],{"type":30,"value":1335},"从一个好用的 AI 助手，变成了一个可扩展的 AI 编排平台",{"type":30,"value":75},{"type":24,"tag":36,"props":1338,"children":1339},{},[1340],{"type":30,"value":1341},"它不再是\"回答问题的聊天机器人\"，而是：",{"type":24,"tag":305,"props":1343,"children":1344},{},[1345,1353,1361],{"type":24,"tag":309,"props":1346,"children":1347},{},[1348],{"type":24,"tag":57,"props":1349,"children":1350},{},[1351],{"type":30,"value":1352},"AI 工具的调度中心",{"type":24,"tag":309,"props":1354,"children":1355},{},[1356],{"type":24,"tag":57,"props":1357,"children":1358},{},[1359],{"type":30,"value":1360},"编程任务的编排引擎",{"type":24,"tag":309,"props":1362,"children":1363},{},[1364],{"type":24,"tag":57,"props":1365,"children":1366},{},[1367],{"type":30,"value":1368},"本地 AI 生态的连接器",{"type":24,"tag":36,"props":1370,"children":1371},{},[1372],{"type":30,"value":1373},"这种变化带来的可玩性，远超我的预期。",{"type":24,"tag":36,"props":1375,"children":1376},{},[1377],{"type":24,"tag":57,"props":1378,"children":1379},{},[1380],{"type":30,"value":1381},"推荐尝试：",{"type":24,"tag":345,"props":1383,"children":1384},{},[1385,1390,1395,1400],{"type":24,"tag":309,"props":1386,"children":1387},{},[1388],{"type":30,"value":1389},"安装 OpenCode，连接 qwenpaw",{"type":24,"tag":309,"props":1391,"children":1392},{},[1393],{"type":30,"value":1394},"体验 ACP 流式交互",{"type":24,"tag":309,"props":1396,"children":1397},{},[1398],{"type":30,"value":1399},"尝试多 Agent 协作编程",{"type":24,"tag":309,"props":1401,"children":1402},{},[1403],{"type":30,"value":1404},"探索更多 ACP 客户端",{"type":24,"tag":42,"props":1406,"children":1407},{},[],{"type":24,"tag":46,"props":1409,"children":1411},{"id":1410},"参考链接",[1412],{"type":30,"value":1410},{"type":24,"tag":305,"props":1414,"children":1415},{},[1416,1428,1438],{"type":24,"tag":309,"props":1417,"children":1418},{},[1419],{"type":24,"tag":1420,"props":1421,"children":1425},"a",{"href":1422,"rel":1423},"https://github.com/agentclientprotocol/python-sdk",[1424],"nofollow",[1426],{"type":30,"value":1427},"ACP 官方文档",{"type":24,"tag":309,"props":1429,"children":1430},{},[1431],{"type":24,"tag":1420,"props":1432,"children":1435},{"href":1433,"rel":1434},"https://qwenpaw.agentscope.io/docs/acp-integration",[1424],[1436],{"type":30,"value":1437},"qwenpaw ACP 集成文档",{"type":24,"tag":309,"props":1439,"children":1440},{},[1441],{"type":24,"tag":1420,"props":1442,"children":1445},{"href":1443,"rel":1444},"https://github.com/nicholasgasior/opencode",[1424],[1446],{"type":30,"value":1447},"OpenCode GitHub",{"type":24,"tag":42,"props":1449,"children":1450},{},[],{"type":24,"tag":32,"props":1452,"children":1453},{},[1454],{"type":24,"tag":36,"props":1455,"children":1456},{},[1457,1462],{"type":24,"tag":57,"props":1458,"children":1459},{},[1460],{"type":30,"value":1461},"加加笔记",{"type":30,"value":1463}," | AI 应用开发者 | 公众号主理人\n关注我，一起探索 AI 的更多可能性 🚀",{"type":24,"tag":1465,"props":1466,"children":1467},"style",{},[1468],{"type":30,"value":1469},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":274,"depth":274,"links":1471},[1472,1473,1474,1479,1484,1488,1492,1496,1501,1506,1507],{"id":48,"depth":274,"text":48},{"id":97,"depth":274,"text":100},{"id":210,"depth":274,"text":213,"children":1475},[1476,1477,1478],{"id":217,"depth":445,"text":217},{"id":301,"depth":445,"text":301},{"id":336,"depth":445,"text":336},{"id":397,"depth":274,"text":400,"children":1480},[1481,1482,1483],{"id":403,"depth":445,"text":217},{"id":472,"depth":445,"text":301},{"id":504,"depth":445,"text":336},{"id":528,"depth":274,"text":531,"children":1485},[1486,1487],{"id":534,"depth":445,"text":217},{"id":559,"depth":445,"text":301},{"id":590,"depth":274,"text":593,"children":1489},[1490,1491],{"id":596,"depth":445,"text":217},{"id":721,"depth":445,"text":301},{"id":756,"depth":274,"text":759,"children":1493},[1494,1495],{"id":762,"depth":445,"text":217},{"id":787,"depth":445,"text":301},{"id":825,"depth":274,"text":828,"children":1497},[1498,1499,1500],{"id":831,"depth":445,"text":834},{"id":866,"depth":445,"text":869},{"id":1078,"depth":445,"text":1081},{"id":1147,"depth":274,"text":1150,"children":1502},[1503,1504,1505],{"id":1153,"depth":445,"text":1156},{"id":1192,"depth":445,"text":1195},{"id":1272,"depth":445,"text":1272},{"id":1323,"depth":274,"text":1323},{"id":1410,"depth":274,"text":1410},"markdown","content:blogs:qwenpaw-acp-ai-programming.md","content","blogs/qwenpaw-acp-ai-programming.md","blogs/qwenpaw-acp-ai-programming","md",{"loc":4},1777027343782]