Changelog, dev startup, README, AgentHub 0.4.0, model catalog, and landing site (#7)
Branch-length batch covering tooling, the model layer, the Web App and the public surfaces. Highlights: - Changelog: a per-release `changelog/<version>/` tree, grouped by the surface each change touches, with a root CHANGELOG.md holding one line per release. - Dev startup: `scripts/dev-prebuild.mjs` serializes the skills+core prebuild behind a lock and keeps `pnpm install` current; `pnpm dev` runs server+web together. - AgentHub 0.3.3 -> 0.4.0: OmniMessage complete payloads carry one opaque `fidelity` object in place of item-level `signature`/`phase`, threaded verbatim through Trace, replay and resume; malformed classification adapted to the new error types. - Model layer: a model is always referenced by an explicit `(provider, model_id)` pair. The provider is never inferred, guessed or defaulted -- both the catalog inference and the unique-match config resolution are gone, and CLI, SDK, server routes and run_subagent all require the complete pair. Catalog gains the Qwen Token Plan, Qwen Pay-As-You-Go and Fireworks AI gateways, plus an expanded OpenRouter group. - Web App: catalog preset sync and per-group speed test on the Models page, positional slash commands, a markdown renderer, skill-library update reminders, and a vertically centred draft page whose upward menus size themselves to the room available. - Public surfaces: restructured READMEs, the penguin.ooo landing site and blog, refreshed benchmark results for both suites, and the demo videos playing on the landing page. Includes the fixes from a full review of the branch: 23 confirmed findings, among them a provider-inference bug that could send one vendor's API key to another vendor's endpoint, and an Escape handler that destroyed the composer's contents unrecoverably. Verified on the branch head: pnpm test (1127 passing, 7 packages), pnpm typecheck and pnpm format:check clean, Playwright e2e 14/14.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* work-summary.ts unit tests (issue #76): group header duration is computed as the union
|
||||
* of time intervals — overlapping time from parallel tools counts once; sequential calls
|
||||
* accumulate as usual (gaps don't count); approval waits are excluded per the durationMs
|
||||
* convention; the argument-generation segment and execution segment are separate intervals
|
||||
* (generation is not shifted into the execution period); items missing a start point fall
|
||||
* back to direct accumulation.
|
||||
* work-summary.ts unit tests: the group header duration is the group's real wall-clock
|
||||
* span — earliest segment start → latest segment end — including approval waits and the
|
||||
* gaps between steps (the header answers "how long did this group take"; per-item cards
|
||||
* keep the fine-grained settled durations). Parallel work counts once by construction.
|
||||
* Items missing a start point fall back to direct accumulation on top of the span; the
|
||||
* returned startMs is the earliest start stamp of ANY item (settled or not) — the anchor
|
||||
* the header ticks from while the group is still running.
|
||||
*/
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { ChatItem } from "../src/lib/omni/stream-model";
|
||||
@@ -41,56 +42,65 @@ const tool = (
|
||||
});
|
||||
|
||||
describe("summarizeWork", () => {
|
||||
it("overlapping time of parallel tools counts once (15-way parallel for 9 minutes no longer reports 99 minutes)", () => {
|
||||
it("parallel work counts once: 15-way parallel over 9 minutes reports 9 minutes", () => {
|
||||
const nine = 9 * 60_000;
|
||||
const items = Array.from({ length: 15 }, () => tool({ start: 0, durationMs: nine }));
|
||||
expect(summarizeWork(items)).toEqual({ steps: 15, durationMs: nine });
|
||||
expect(summarizeWork(items)).toEqual({ steps: 15, durationMs: nine, startMs: 0 });
|
||||
});
|
||||
|
||||
it("partial overlaps merge as a union", () => {
|
||||
it("staggered parallel tools span first start → last end", () => {
|
||||
const items = [
|
||||
tool({ start: 0, durationMs: 60_000 }),
|
||||
tool({ start: 10_000, durationMs: 60_000 }),
|
||||
tool({ start: 20_000, durationMs: 70_000 }),
|
||||
];
|
||||
expect(summarizeWork(items)).toEqual({ steps: 3, durationMs: 90_000 });
|
||||
expect(summarizeWork(items)).toEqual({ steps: 3, durationMs: 90_000, startMs: 0 });
|
||||
});
|
||||
|
||||
it("sequential calls accumulate as usual; gaps do not count", () => {
|
||||
it("gaps between sequential steps count toward the span", () => {
|
||||
const items = [
|
||||
tool({ start: 0, durationMs: 10_000 }),
|
||||
tool({ start: 15_000, durationMs: 10_000 }),
|
||||
];
|
||||
expect(summarizeWork(items)).toEqual({ steps: 2, durationMs: 20_000 });
|
||||
// [0,10s] then a 5s gap then [15s,25s]: the group took 25s of wall time.
|
||||
expect(summarizeWork(items)).toEqual({ steps: 2, durationMs: 25_000, startMs: 0 });
|
||||
});
|
||||
|
||||
it("thinking and tools merge on the same axis; thinking does not count as a step", () => {
|
||||
it("thinking and tools share the same axis; thinking does not count as a step", () => {
|
||||
const items = [thinking(0, 5_000), tool({ start: 5_000, durationMs: 10_000 })];
|
||||
expect(summarizeWork(items)).toEqual({ steps: 1, durationMs: 15_000 });
|
||||
expect(summarizeWork(items)).toEqual({ steps: 1, durationMs: 15_000, startMs: 0 });
|
||||
});
|
||||
|
||||
it("approval waits excluded: intervals start at approvalAtMs", () => {
|
||||
it("approval waits are included: the span runs from the call start, not the approval", () => {
|
||||
const items = [
|
||||
// Call ready at 0, human approves at 100s, execution 100-105s.
|
||||
tool({ start: 0, approvalAt: 100_000, durationMs: 5_000 }),
|
||||
tool({ start: 102_000, durationMs: 8_000 }),
|
||||
];
|
||||
// [100s,105s] ∪ [102s,110s] = 10s; starting from callStartedAtMs by mistake would include the 100s approval wait.
|
||||
expect(summarizeWork(items)).toEqual({ steps: 2, durationMs: 10_000 });
|
||||
// Span 0 → 110s: the 100s spent waiting for the human is part of how long the group took.
|
||||
expect(summarizeWork(items)).toEqual({ steps: 2, durationMs: 110_000, startMs: 0 });
|
||||
});
|
||||
|
||||
it("argument-generation and execution are separate intervals: generation is not shifted into the execution period", () => {
|
||||
it("argument generation anchors the start; execution end anchors the end", () => {
|
||||
const items = [
|
||||
// A: arg generation 0-10s, approval wait 10-100s, execution 100-110s (durationMs = 10s generation + 10s execution).
|
||||
// A: arg generation 0-10s, approval wait 10-100s, execution 100-110s (durationMs = 10s + 10s).
|
||||
tool({ argStart: 0, start: 10_000, approvalAt: 100_000, durationMs: 20_000 }),
|
||||
// B: execution 110-120s. If A were computed entirely from its execution start ([100s,120s]), it would fully overlap with B, leaving only 20s.
|
||||
// B: execution 110-120s.
|
||||
tool({ start: 110_000, durationMs: 10_000 }),
|
||||
];
|
||||
// Correct union: [0,10s] ∪ [100s,120s] = 30s.
|
||||
expect(summarizeWork(items)).toEqual({ steps: 2, durationMs: 30_000 });
|
||||
expect(summarizeWork(items)).toEqual({ steps: 2, durationMs: 120_000, startMs: 0 });
|
||||
});
|
||||
|
||||
it("items missing a start point fall back to direct accumulation; items without a duration only count as steps", () => {
|
||||
const items = [tool({ start: 0, durationMs: 10_000 }), tool({ durationMs: 7_000 }), tool()];
|
||||
expect(summarizeWork(items)).toEqual({ steps: 3, durationMs: 17_000 });
|
||||
expect(summarizeWork(items)).toEqual({ steps: 3, durationMs: 17_000, startMs: 0 });
|
||||
});
|
||||
|
||||
it("a still-streaming first item already anchors startMs (live tick before anything settles)", () => {
|
||||
expect(summarizeWork([thinking(1_000)])).toEqual({ steps: 0, durationMs: 0, startMs: 1_000 });
|
||||
});
|
||||
|
||||
it("no timestamps at all: no startMs key", () => {
|
||||
expect(summarizeWork([tool({ durationMs: 7_000 })])).toEqual({ steps: 1, durationMs: 7_000 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user