Skip to content

feat(web): capture exact provider requests and authoritative execution timing #454

Open

Description

@tt-a1i

Problem

The persisted Session trajectory shipped in #447 completes the first slice of #446: ordered user prompts, assistant messages, tool calls and tool results with bounded inspection. It does not expose the exact final provider request or authoritative execution duration. Track those remaining capabilities here, separately from the shipped history view.

Scope and acceptance

  • Identify a Pi-owned seam that observes the final effective request after any request-replacing hooks. Clearly distinguish exact captured requests from reconstructed Session/context projections. If the seam is unavailable, document the upstream dependency instead of claiming capture.
  • Inspect prompt/system content and tool schemas only to the extent actually observed at that seam. Associate evidence with the exact Session, turn and provider request attempt; retries, cancellation, failure and unavailable evidence remain distinct.
  • Record timing from authoritative start/end events; do not treat persisted entry timestamps, record order or UI animation as execution duration. Make overlapping tool executions and incomplete intervals explicit.
  • Keep capture optional, bounded and inspectable. Define redaction, retention and cleanup before storing sensitive request data; never include credentials or authorization headers in the browser projection.
  • Reuse Pi Session/runtime ownership and existing Web inspection surfaces. Avoid a second provider stack or duplicate control plane.
  • Cover payload replacement, retry, concurrent calls, cancellation, reconnect, truncation and unsupported-provider/seam cases. Document precisely what was captured versus inferred.

This issue tracks design and implementation work; it does not claim those capabilities currently exist and does not authorize collecting or publishing private user Session payloads.

References

Activity

  1. sowen1023 commented on Sep 8, 2026

    @sowen1023
    Contributor

    我来认领 #454,先推进“基于 Pi 原生事件的真实执行耗时”子范围,请维护者确认并分配给 @sowen1023。

    计划范围:

    • 先核对当前 upstream main 的 Pi 原生生命周期入口,在运行时记录工具执行的开始/结束及单调时钟耗时,绑定准确的 Session、执行轮次和 tool-call identity。
    • 区分成功、失败、取消、并发重叠及缺失结束事件的未知区间;不把持久消息时间戳或 UI 动画当成执行耗时,也不把后台任务的启动工具返回当成后台任务完成。
    • 复用现有 Web inspection/snapshot/SSE 边界,明确数量、字节、保留和清理上限,覆盖刷新/重连、Session 切换与迟到事件。
    • 补充运行时、协议、UI 和真实浏览器验证,执行 bun run check 与 bun run test,并按仓库规范记录证据和限制。

    完整最终 provider 请求捕获先保持为后续范围:需要先证明存在所有请求替换钩子执行后的 Pi-owned 观察入口,并明确脱敏、保留与清理策略;若没有该入口,会记录上游依赖,不用重建的 Session/context 冒充真实请求。

    首个 PR 会使用 Refs #454,准确说明完成的耗时范围与剩余请求捕获工作,不提前关闭整个 Issue。本次认领不涉及采集或发布私人 Session payload,也不引入第二套 provider 或控制平面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions