Files
deepseek-harness/apps/web/tests/snapshots/question-composer/answered.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.2 KiB

  • banner:
    • navigation "Session hierarchy":
      • button "Use the ask_user_question tool to" [disabled]
    • tablist:
      • tab "Chat" [selected]
      • tab "Trajectory"
  • text: "Use the ask_user_question tool to ask me exactly one question with id "color", question "Which color do you prefer?", header "Pick one", and two options: label "Blue" with description "A cool recessive hue that reads as calm and trustworthy in long reading sessions and dense dashboards.", and label "Green" with description "A restful mid-spectrum hue with the highest perceived brightness, easiest on the eye over long sessions." After I answer, reply with the single word DONE and stop. {{clock}}"
  • button "复制":
    • img
  • button "在新对话中分支":
    • img
  • button "编辑":
    • img
  • button "▸ 上下文注入"
  • button "Think The user wants me to use the ask_user_question tool with specific parameters. Let me do exactly that.":
    • img
    • img
    • text: Think The user wants me to use the ask_user_question tool with specific parameters. Let me do exactly that.
  • button:
    • img
    • img
  • text: "Tool call ask_user_question · {"questions": [{"id": "color", "question": "Which color do you prefer?", "header": "Pick one", "options": [{"label": "Blue", "description": "A cool recessive hue that reads as calm and trustworthy in long reading sessions and dense dashboards."}, {"label": "Green", "description": "A restful mid-spectrum hue with the highest perceived brightness, easiest on the eye over long sessions."}]}]}"
  • button "Think The user answered "Blue". I should now reply with the single word DONE and stop.":
    • img
    • img
    • text: Think The user answered "Blue". I should now reply with the single word DONE and stop.
  • paragraph: 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 · 2 steps Tool call {{duration}} Context 3% of 128K Cache hit 95% Input 8.6K tok · Output 180 tok