Repository navigation
Conversation
新增 tps 扩展:每次 agent 运行结束时输出 token 吞吐量统计行 (TPS/out/in/cache r/w/total/elapsed),移植自 pi 项目的 tps.ts。 新增 extension-notify 模块作为会话级通知注入点(仿 ai/abort.scm): TUI worker 会话内 arm 一个经 chan 投递回主线程渲染的回调,扩展经 ctx.ui.notify 触达聊天区状态行;未 arm 时扩展回退 stderr 输出, 与 ctx.hasUI 守护语义一致。 扩展事件系统桥接:agent loop 在 agent_start/agent_end 事件同步桥接 到扩展事件系统,并在 pi-emit! 自动构造 ctx 时注入 notify/has-ui。 TUI 渲染:新增 make-status-card 与 pi-app-add-status-message!, event_chan 的 tps_report 事件渲染为聊天区 dim 提示行(上方一空行间隔)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
新增 TPS(token throughput)扩展,并在扩展事件系统中引入会话级通知注入点,使扩展能在 TUI 聊天区输出状态行。
主要变更
extensions/tps.scm):每次 agent 运行结束时输出 token 吞吐量统计行(TPS/out/in/cache r/w/total/elapsed),移植自 pi 项目的 tps.ts。code/liii/pi/code/core/extension-notify.scm):作为会话级通知注入点(仿 ai/abort.scm)。TUI worker 会话内 arm 一个经 chan 投递回主线程渲染的回调,扩展经 ctx.ui.notify 触达聊天区状态行;未 arm 时扩展回退 stderr 输出,与 ctx.hasUI 守护语义一致。agent_start/agent_end事件同步桥接到扩展事件系统;pi-emit!自动构造 ctx 时注入notify/has-ui。make-status-card与pi-app-add-status-message!,event_chan的tps_report事件渲染为聊天区 dim 提示行(上方一空行间隔)。测试
新增
tests/liii/pi/extensions/tps-test.scm。