pi-web icon indicating copy to clipboard operation
pi-web copied to clipboard

bug:会话重命名标题报错

Open Lamb-Yang opened this issue 4 months ago • 2 comments

报错提示 No default stream function configured. Pass streamFn explicitly or call setDefaultStreamFn(). 让pi自己分析了一把结论如下

点击 Generate title 时,pi-web 会走接口:

POST /api/sessions/[id]/auto-name

它会新建一个临时 Agent 来给会话起名。问题在于:

代码传的是:streamFunction: agent.streamFunction 但 Agent 构造函数读的是:options.streamFn 字段名对不上,streamFn 实际是空的 于是落到 getDefaultStreamFn(),再抛出:

No default stream function configured. Pass streamFn explicitly or call setDefaultStreamFn().

Lamb-Yang avatar Jul 23 '26 17:07 Lamb-Yang

后让pi自己修复了下

做了什么 修改了本机 [email protected] 的 auto-name 路由:

文件: .../node_modules/@agegr/pi-web/.next/server/app/api/sessions/[id]/auto-name/route.js 改动: streamFunction: b.streamFunction → streamFn: b.streamFunction

经过我测试可以重新命名标题

Lamb-Yang avatar Jul 23 '26 17:07 Lamb-Yang

fixed in adc919214bdd073a75369b979943a42de82b93a7

agegr avatar Jul 25 '26 09:07 agegr