Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
docs(agent): document the session cache readout
thinhlpg182c9c732937
diff --git a/docs/src/pages/docs/agent/console.mdx b/docs/src/pages/docs/agent/console.mdxindex 25666544f..616470a00 100644--- a/docs/src/pages/docs/agent/console.mdx+++ b/docs/src/pages/docs/agent/console.mdx@@ -41,7 +41,7 @@ jan --task "..." # with a first message already sent| Region | What it shows || --- | --- |-| Header | Model, reasoning effort, clock, turn count, context usage, throughput, state |+| Header | Model, reasoning effort, clock, turn count, context usage, prompt-cache hit rate, throughput, state || Transcript | The conversation, with tool calls folded into summary rows || Receipt | Per turn: context sent, tokens produced, elapsed, rate || Input | Where you type |@@ -83,6 +83,23 @@ missing-character box - clear the field in `/settings` and save. That writes `wathe off switch. Pressing <kbd>x</kbd> on the row is the other direction: it removes the key, so thedefault 👋 comes back.+### The prompt-cache hit rate++Providers cache the front of a request, so a turn that reuses it costs a fraction of a cold one. The+header carries the share of this session's prompt tokens that came from the cache:++```+ jan agent tokamak-1-preview effort medium 10:40:49 turn 1/400 ctx 6K/128K cache 75% [ready]+```++The segment appears only once a route has reported a cache field: a route that reports nothing shows+no badge at all, rather than a fabricated `0%`. A rate that reads `0%` is drawn in red, because a+prefix rewritten every turn and never read is the state worth interrupting for. After a resumed or+forked history the badge adds `(this process)`, since the counters begin where this process did.++`/context` carries the full numbers - a session total and the last request's sample - see+[Context and compaction](/docs/agent/context#the-prompt-cache-lines).+## ReasoningWhile a model works it may emit a chain of thought before it lands on an answer. By default thediff --git a/docs/src/pages/docs/agent/context.mdx b/docs/src/pages/docs/agent/context.mdxindex 32181857d..199072ce6 100644--- a/docs/src/pages/docs/agent/context.mdx+++ b/docs/src/pages/docs/agent/context.mdx@@ -41,8 +41,9 @@ purpose: context is the size of the request, output is what came back.Opens a centered overlay on top of the live transcript (the turn keeps running behind it).Inside is a rail that shows the fill as a percentage of the window, a visual bar with the`^` marker at the current usage point and `╳` marking the auto-compact reserve zone, a-token scale, and a headroom line (`N tokens available before auto-compact`), followed by a-per-category breakdown: System prompt, System tools, Project context, Skills, and Messages.+token scale, and a headroom line (`N tokens available before auto-compact`), the+prompt-cache lines when the route reports any, followed by a per-category breakdown:+System prompt, System tools, Project context, Skills, and Messages.Press <kbd>Esc</kbd>, <kbd>q</kbd>, or <kbd>Ctrl</kbd>+<kbd>C</kbd> to close; closing nevercancels the turn.@@ -57,6 +58,25 @@ When a provider publishes prices for the model, the overlay also carries the sesspend (`Session cost (estimated): ~$0.42`). That is every request so far, not the window: see[`/usage`](#usage-and-cost) for the per-model breakdown.+### The prompt-cache lines++When the route reports cache usage, the overlay adds the numbers behind the header badge:++```+Prompt cache (session): 1.2M read (91% of prompt), 140K written+Prompt cache (last request): 90K read (75% of prompt), 12K written+```++The session line is `cached / prompt` over every request this process sent - a share of the+tokens, not a mean of per-turn percentages, since a 10-token request and a 100K one do not+describe the same prefix. A resumed or forked history's counters start where this process did,+and the line says `this process` when they do.++A route that reports a cache field with a zero renders `0%`, in the alarm colour. A route that+reports no cache field at all says `Prompt cache: not reported`, and only once a request has+been measured. Those are different answers and are never conflated: the first is a cold cache,+the second is silence.+## Where the window size comes fromIn order of precedence: