Repository navigation
v0.2.20
The usage chart can be split by World, the console's cost-today figure no longer rescans the whole usage ledger on every model call, the run log keeps retries that failed with different errors apart, and Cormini no longer exits when a workspace subtree holds more than about 120,000 files.
Changes for extension authors
/api/usage: each bucket ofseriescarriesbyWorld, keyed by World id, andunattributed, with the same attribution rules as the range-widebyWorld; the parts of a bucket add up to the bucket and one World's parts across the buckets add up to itsbyWorldrow.byWorldModel[world][model]andunattributedByModel[model]cross them with the model.unattributedandunattributedByModelare omitted in a bucket that has no unattributed part.UsageSeriesPointincortico/core/cost.tshas the same four fields; code that builds one itself has to addbyWorldandbyWorldModel(thanks @kwk1001, #454).usageRecordRange(opts)incortico/core/cost.tsreturns the two instantsusageRecordFilterfilters by, andUsageLog.readRange({ sinceMs, untilMs })returns the records fromsinceMson, from memory after its first call (#465).- Run-log folding groups by the error text as well as by area and event or message:
record.err.message, or a stringerrorerrorfield indata, with digits replaced by#and cut to 80 characters. Warnings and errors that share a message and differ in the error are each written. Incident snapshots underincidents/use the same key, so errors with different texts each get a snapshot (#464).
Core
- A request for today's usage without
dailyTokenDays, which is what the console's cost-today figure sends when the page opens and after every main-loop model call, is answered from memory. The first such request after a start scansusage.jsonlonce and keeps the records from the start of today's range; later appends are added to them, the range moves forward at midnight, and requests that arrive together share that one scan. Before, every request read the whole ledger. On a 448 MiB ledger with three console pages open, a repeated request took about 5.4 s and delayed messages from child processes by about 3.2 s at the 95th percentile; it now takes 14 ms and delays them by at most 14 ms. The first request after a start still takes the time of one scan, 1.65 s on that ledger. The usage page sendsdailyTokenDaysand still reads the whole ledger on each request. Editingusage.jsonlfrom outside while the process runs is not reflected in the cost-today figure until a restart; clearing it from the storage page is (thanks @milan-fu for the reports and the reproduction script, #459 and #421, #465). - The run log no longer folds retries with different errors into one line.
Provider attempt failed; retryingis logged with the same message for every failed attempt, so a round whose attempts failed withLLM API 550and withfetch failed (ECONNRESET: read ECONNRESET)left only the first one in the log, and the summary line at the end of the 30-second window repeated the first one's error. Errors that differ only in digits, such asLLM API 550andLLM API 502, still fold together (thanks @bikaqiumiao for the log in Pal-AI-Lab/Coopanion#857, #464).
WebUI
- The usage chart has a World split beside type, purpose and model, with Unattributed as its last segment. It combines with type and model. World and purpose exclude each other: pressing one releases the other. With the calls metric the World split is disabled, as the type split is, because one request counts for every World that got a share of it (thanks @kwk1001, #454).
- When a split has more keys than the chart palette has colors (8), the 7 largest by the current metric each keep a segment and the rest are merged into one
N otherssegment. Hovering its legend entry lists the merged keys, and the tooltip lists each of them under the merged row. This applies to the purpose and model splits too, which used to reuse colors past the eighth key (thanks @kwk1001, #454). - A key's chart color is picked from a hash of its name instead of its position in the sorted keys, so adding or removing a key no longer recolors every key after it. The colors of existing charts change once with this version (thanks @kwk1001, #454).
Bots
- Cormini: listing the workspace no longer throws
RangeError: Maximum call stack size exceededwhen one subtree holds more than about 120,000 files, such as anode_modulestree inside a project in the workspace. The error came while building the system prefix, the main loop exited, and it exited again at every later rebuild (#458).