feat/task-slice-reasoning-abort #26

Merged
clawdie merged 4 commits from feat/task-slice-reasoning-abort into feat/go-task-slice-v1 2026-09-21 01:24:40 +02:00
Owner
No description provided.
zot reports reasoning tokens separately from output — a distinct billed
count for reasoning models such as DeepSeek-R1. Both the Rust PaneUsage
and the Go Usage projection dropped the `reasoning` field, so the token
ledger undercounted by the full reasoning amount even though `cost_usd`
stayed correct.

An aborted turn (`turn_end{stop:"aborted"}` with no standalone error
frame) was also finalized as success: both terminal readers keyed on
`done`/`error` only. Map abort to error in the normalized event fold and
close the task as failed with its partial usage billed, so the trailing
bare `done` cannot flip it back to success.

- Go: Usage/ledger/task slice gain reasoning_tokens; Normalized() maps
  stop:aborted -> error; Consume() finalizes aborted turns as failed.
- Rust: PaneUsage/Task/TaskCost/schema/set_task_cost/row_to_task gain
  reasoning_tokens; zot_event_type maps stop:aborted -> error; the RPC
  completion reader finalizes aborted turns as failed.
- Fixtures: reasoning_tokens expectations across normalized-events.json
  and task-records.json; new zot-abort.jsonl stream + abort case.

Linux proof: check-go.sh green, cargo fmt/clippy clean, glasspane (58),
ledger (31), daemon lib (197) all pass.
Formatting-only: rustfmt 1.95 wants the let-chain guard on one line.
No behavior or scope change.
Move reasoning_tokens to the end of the Go tasks CREATE TABLE so the
column order matches the Rust migration (reasoning_tokens is the last
additive column). Replay the normalized-events pack through an explicit
id-to-fixture map that panics on an unknown stream, covering zot-abort.
test(contracts): replay every task-records case via a case-id fixture map
Some checks failed
CI / python-tests (pull_request) Successful in 1s
format-check / prettier (pull_request) Successful in 4s
leak-guard / guard (pull_request) Successful in 1s
ci-gate / gate (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
92960c444e
Add an id-to-fixture map for task-records cases that panics on unknown
case ids, and an exhaustive test iterating every pack case entry through
it. Correct the stream_fixture comment to claim only the pack-to-fixture
direction it actually enforces.
clawdie merged commit 2f4c1c6b05 into feat/go-task-slice-v1 2026-09-21 01:24:40 +02:00
clawdie deleted branch feat/task-slice-reasoning-abort 2026-09-21 01:24:40 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/colibri!26
No description provided.