mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-10 01:29:41 +00:00
JetBrains Copilot has two turn shapes in the Nitrite .db: - ask mode — the reply is a `Markdown` record's `text`; - agent / plan mode (e.g. PyCharm agent sessions, `/plan …`) — the reply is the `reply` field of an `AgentRound` record, and the `Markdown` record instead holds the USER's prompt. extractResponseText only read Markdown, so agent-mode turns yielded no reply text: they were discovered (session/turn counts showed up) but priced at $0 because output tokens came out zero. On this machine that silently under-counted a PyCharm session ($0 → $0.35) and several IntelliJ agent turns. Determine the mode by the PRESENCE of an `AgentRound` record and read only that record's `reply` (collecting every non-empty round in a multi-round blob). Crucially, an agent blob whose reply is empty — a failed turn or a pure tool-call round — does NOT fall back to the Markdown record, so a user prompt is never mistaken for the assistant's output; such turns bill $0 as before. Ask-mode blobs (no AgentRound) keep reading Markdown. Plan mode's sidecar records — Thinking, PendingChanges (proposed diff, under `content`), AskQuestion, Notification, SubTurn, and file-read `text` results — are never read as output. Verified across all local stores: the two reply shapes never coexist in one blob, so the split is unambiguous. Tests: agent-mode reply extraction (ignoring the prompt Markdown), pure tool-call rounds → $0, multi-round collection, and a failed agent turn → $0. docs/providers/copilot.md documents both turn shapes and the ignored sidecar records. |
||
|---|---|---|
| .. | ||
| design | ||
| providers | ||
| architecture.md | ||