feat(lanes,run,pricing): Changes sidebar editor, staged groups, image drop, auto pricing

- Changes panel at full screen: the whole Files view (finder, expand-all,
  tree) becomes a left sidebar and the Files tab is dropped; a working-copy
  file opens straight into the editor (Save/Cancel live once the text
  differs, Cancel restores it, Whole file toggles back to the diff), and the
  page is height-locked so the editor no longer collapses with no live run.
- Overview splits into Staged Changes / Changes groups in the work range.
- A changed file's whole tree row takes its status tint.
- Drag an image onto the lane terminal: POST /api/run/drop-image saves it
  (png/jpeg/gif/webp, random name, 0600, pruned after a day) and the path
  is pasted into the pane, which is how claude attaches it.
- Claude Opus 5.5 gets its own pricing row (4/20/0.2/5/8, fast 8/40);
  claude-opus-5% had been pricing it as Opus 5.
- server/lib/pricing-sync.js: a model family used in token_usage with no
  row of its own is inserted from LiteLLM's public price list, never
  updated; off with AGENTHUB_PRICING_SYNC=0. repo-links allows exactly
  that one third-party GitHub raw URL.
This commit is contained in:
2026-09-24 17:05:15 +07:00
parent 804b193ac7
commit 158783d5d5
25 changed files with 1266 additions and 540 deletions
+39
View File
@@ -324,3 +324,42 @@ describe("calculateCost — date-effective (intro) pricing", () => {
);
});
});
describe("DEFAULT_PRICING — Opus 5.5", () => {
it("prices claude-opus-5-5 at its own rates, not Opus 5's", () => {
const os = require("os");
const path = require("path");
process.env.DASHBOARD_DB_PATH = path.join(
os.tmpdir(),
`pricing-opus55-${Date.now()}-${process.pid}.db`
);
const { DEFAULT_PRICING } = require("../db");
const rules = DEFAULT_PRICING.map(([p, n, i, o, cr, cw, cw1h, fi, fo]) => ({
model_pattern: p,
display_name: n,
input_per_mtok: i,
output_per_mtok: o,
cache_read_per_mtok: cr,
cache_write_per_mtok: cw,
cache_write_1h_per_mtok: cw1h,
fast_input_per_mtok: fi,
fast_output_per_mtok: fo,
}));
// A real session: Claude Code's /cost reported $2.72 for exactly these
// counts (all cache writes at the 1h tier); Opus 5's rates gave $4.86.
const r = calculateCost(
[
bucket({
model: "claude-opus-5-5",
input_tokens: 102,
output_tokens: 25_408,
cache_read_tokens: 5_866_977,
cache_write_tokens: 129_432,
cache_write_1h_tokens: 129_432,
}),
],
rules
);
assert.equal(r.total_cost.toFixed(2), "2.72");
});
});