summaryrefslogtreecommitdiffhomepage
path: root/frontend-context-size-handoff.md
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-30 01:30:06 +0900
committerAdam Malczewski <[email protected]>2026-06-30 01:30:06 +0900
commitbf74aeab143a49005c380706ae9847cf064fd2f2 (patch)
treec9e93dc0ebe818e7c0d0aafeba8387afd161da3f /frontend-context-size-handoff.md
parent6dd9ea9b935e5011c16faed6c869c976cf5ff172 (diff)
downloaddispatch-main.tar.gz
dispatch-main.zip
chore: remove old handoff docs, plans, review reports, and task lists from rootHEADmain
Removed 40+ markdown files that were cluttering the repo root: - frontend-*-handoff.md (28 files) — historical API contract handoffs, features all implemented - backend-to-fe-handoff.md, backend-to-fe-handoff-2.md — old handoff docs - broken-chat-repair-handoff.md — old repair handoff - PLAN-mcp.md, PLAN-per-edit-diagnostics.md — old planning docs - ai-review-report.md, crash-review-report.md — one-time review reports - tasks.md, HANDOFF.md — outdated status docs (git log is the source of truth) Kept: AGENTS.md, GLOSSARY.md, ORCHESTRATOR.md, README.md Also: gitignored ai-review-report.md so future Gemini reviews don't commit it
Diffstat (limited to 'frontend-context-size-handoff.md')
-rw-r--r--frontend-context-size-handoff.md47
1 files changed, 0 insertions, 47 deletions
diff --git a/frontend-context-size-handoff.md b/frontend-context-size-handoff.md
deleted file mode 100644
index a774a0c..0000000
--- a/frontend-context-size-handoff.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# FE handoff — context size (current context-window usage)
-
-Courier this to `../frontend` (cross-repo contract change; `lsp references` does not
-span repos — ORCHESTRATOR §7). Backend commit adds an optional `contextSize` field; no
-breaking change.
-
-## What shipped (backend)
-
-A new optional field **`contextSize`** (a token count) now flows to the frontend on two
-existing carriers. Both are computed identically and are EQUAL for the same turn:
-
-1. **Live** — `TurnDoneEvent.contextSize?: number` (the `done` AgentEvent, arriving in a
- `chat.delta` WS message / the NDJSON stream).
-2. **Persisted** — `TurnMetrics.contextSize?: number`, served by
- `GET /conversations/:id/metrics` (`ConversationMetricsResponse.turns[].contextSize`).
-
-Types: `@dispatch/wire` (`0.4.0 → 0.5.0`), re-exported by
-`@dispatch/transport-contract` (`0.5.0 → 0.6.0`). Bump the pinned `file:` deps.
-
-## Definition (read this — it's subtle)
-
-`contextSize` = **the turn's FINAL step `inputTokens + outputTokens`** — the tokens the
-conversation occupies right now.
-
-It is deliberately **NOT** the aggregate `usage` already on `done` / `TurnMetrics`.
-`usage.inputTokens` is the SUM across steps, which **overcounts** a multi-step / tool-calling
-turn (each step re-prefills the growing prompt). The final step's input already contains all
-prior context, so `finalStep.input + finalStep.output` is the true occupancy. Do not derive
-context size from `usage` yourself — read `contextSize`.
-
-## How to render it
-
-- **Current value = the LATEST turn's `contextSize`.** The chat's "current context usage" is
- whatever the most recent turn reported.
-- **Live update:** when a `done` event arrives, if `event.contextSize !== undefined`, set the
- displayed context size to it.
-- **On (re)hydrate:** call `GET /conversations/:id/metrics`, take the LAST element of `turns`
- that has a defined `contextSize`, and show its value. (Turns appear only after they seal.)
-- **Optionality:** `contextSize` may be `undefined` (provider reported no per-step usage).
- Treat absent as "unknown" — render a placeholder, NOT `0`.
-
-## Not included yet (next step)
-
-The model's **max context-window limit** is a SEPARATE, later field — so a UI like
-`contextSize / limit` (e.g. `34,102 / 200,000`) can't show the denominator yet. For now show
-only the current size (e.g. "34,102 tokens in context"). "context size" = current usage;
-"context window" = the future limit (see GLOSSARY).