Repository navigation
在会话状态面板展示模型首 token 延迟和输出速度 - #1218
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Owner
Author
|
@codex, review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
简介
会话里的 Run 首响反映准备完成后多久出现公开输出。工具调用、排队和流尾的用量事件会影响整轮耗时,用户此前无法从中判断主模型何时开始生成、输出有多快。
会话的「状态」面板现在展示平均首 token 延迟、输出速度及各自的调用数。已有会话从新完成的合格调用开始累计。某项指标没有样本时显示「暂无样本」。
具体改动与影响
界面变更
两次合成调用在真实浏览器中显示 356 ms 和 50.0 tok/s,每项各有 2 次调用。两列布局在 1440 px 和 1024 px 视口均无溢出。下图分别为浅色实测结果和 1024 × 900 暗色空态。
实现依据与设计取舍
归一化帧的语义由模型适配层拥有。主模型资格、成功和失败的处理归会话模型回调。审计仓储按 Run、会话和调用 ID 关联,包含已发布为最终消息的审计。原始流的 message-finish 可能先于模型最终失败,成功资格必须由模型回调确认。决策记录
验证情况
pytest test/e2e/test_session_model_metrics_e2e.py,1 项通过。pytest test/unit/agents/test_session_model_metrics.py test/integration/services/test_session_stream_metrics.py,12 项通过。pytest test/unit -m "not slow",4,134 项通过,128 项跳过。Ruff 检查、格式和导入顺序通过。工程契约检查及其 56 项单测通过。pnpm run lint:check、pnpm run test:unit(1,241 项)和pnpm run build通过。文档pnpm run build、截图产物和git diff --cached --check通过。独立审阅、风险与未验证范围
全新上下文 Reviewer 核对了完整差异、成功与失败的结算顺序、审计归属、会话权限、聚合和测试。已修复后台终态刷新,明确 SDK 用量标准化与帧交付的测量边界,并核对新旧会话的展示说明。
时间戳受网络、网关缓冲、适配器回调和消费端背压影响。TPS 包含首帧及供应商计入的推理 token,短窗口数值可能偏高。进程在审计补写前崩溃可能缺样。此次使用本地合成供应商;真实供应商端点、OpenAI Responses、私有多媒体流和全量 E2E 未实测。