Files
deepseek-harness/apps/web/tests/snapshots/cordis-tool-round/ui.expected.md
Hypatia May 8a8c1965d7 feat(web): show durable token usage and context occupancy in the stats line
The chat stats line took its token totals from the loaded conversation nodes,
so paging changed them and compaction erased the billing behind replaced
content. It also had no way to show context occupancy: the numerator and
capacity never reached the browser.

Both now come from token-meter session projections read through the standard
useProjection seat. Window nodes keep supplying turn and step counts plus LLM
and tool wall times, which are correctly window-scoped facts about what is on
screen; accounting no longer comes from there.

`tokenUsage` supplies billing and cache hit. `contextPressure` supplies
occupancy, pairing the newest provider-reported prompt size with the newest
capacity recorded by `request/context`. Deployments without token-meter drop
the token groups; a route whose adapter advertises no capacity drops the
occupancy group rather than rendering a placeholder.

Occupancy is deliberately approximate: the numerator and capacity are
independent last-wins fields, not one atomic request observation, so switching
models pairs a fresh capacity with the prior route's pressure until the next
request reports usage. It is a user-facing reference figure that nothing in the
harness makes decisions from, and it matches how the TUI status line has always
computed occupancy. The Agent Note and token-meter README state this as a
decision, including why the atomic alternative was implemented and rejected, so
it is not re-litigated as a defect.

Snapshot delta is one added `Context N% of 128K` segment across eight web
goldens; the preceding commit absorbed master's pre-existing golden drift.
2026-07-30 14:48:19 +08:00

2.1 KiB

  • banner:
    • navigation "Session hierarchy":
      • button "Use only Cordis tools. First" [disabled]
    • tablist:
      • tab "Chat" [selected]
      • tab "Trajectory"
  • text: "Use only Cordis tools. First call cordis_inspect with what "temporary". Then call cordis_mount with this exact code: "return { name: \"snapshot-noop\", apply(ctx) {} }". Read its returned id and call cordis_unmount with that exact id. After all three calls succeed, reply exactly CORDIS_UI_DONE and stop. {{clock}}"
  • button "复制":
    • img
  • button "在新对话中分支":
    • img
  • button "编辑":
    • img
  • button "▸ 上下文注入"
  • button "Think The user wants me to:":
    • img
    • img
    • text: "Think The user wants me to:"
  • button:
    • img
    • img
  • text: Inspect temporary
  • 'button "Think Good, no temporary plugins running. Now step 2: call cordis_mount with the exact code."':
    • img
    • img
    • text: "Think Good, no temporary plugins running. Now step 2: call cordis_mount with the exact code."
  • button [expanded]:
    • img
  • text: Mount temporary Plugin typescript
  • button "复制"
  • code: "return { name: "snapshot-noop", apply(ctx) {} }"
  • 'button "Think The id is "dyn-1". Now step 3: call cordis_unmount with that id."':
    • img
    • img
    • text: "Think The id is "dyn-1". Now step 3: call cordis_unmount with that id."
  • button:
    • img
    • img
  • text: Unmount temporary Plugin dyn-1
  • button "Think All three calls succeeded. I should now reply exactly "CORDIS_UI_DONE" and stop.":
    • img
    • img
    • text: Think All three calls succeeded. I should now reply exactly "CORDIS_UI_DONE" and stop.
  • paragraph: CORDIS_UI_DONE
  • button "复制":
    • img
  • button "在新对话中分支":
    • img
  • text: {{clock}}
  • textbox "给智能体发消息"
  • button "Add attachment":
    • img
  • 'button "Access mode, current: Danger Full Access"': Danger Full Access
  • button "选择模型,当前 DeepSeek-V4-Flash":
    • text: DeepSeek-V4-Flash
    • img
  • button "Send message" [disabled]
  • text: 1 turns · 4 steps Tool call {{duration}} Context 13% of 128K Cache hit 77% Input 66.5K tok · Output 312 tok