Upgrading
Changes that can affect existing code, newest first. The full history is in the changelog.
0.5 → 0.6
Progress is unknown until reported; the default metric is 'auto'
Before, every agent had a progress line starting at 0%, and the chart plotted progress by default. Now progress is unknown until an agent reports it, and metric defaults to 'auto': progress once every visible agent reports it, token rate otherwise.
- Agents that never send progress plot their token rate instead of a flat 0% line.
createAgent's 0 doesn't count as reported; a starting value above 0 inagentsdoes. - With an explicit
metric="progress"or"both", an agent without progress has no progress line and reads "–". getLiveMetrics(id)addsprogressKnown.
To keep the old chart, set the metric explicitly:
// Before (0.5): progress was the default
const before = <AgentStat agents={agents} />;
// After (0.6): say which series you want
const after = <AgentStat agents={agents} metric="progress" />;ChartMetric has a new member
An exhaustive switch over ChartMetric needs an 'auto' case.
0.4 → 0.5
spikeZScore is replaced
Spikes are now judged against the agent's usual peak. spikeZScore is gone; use spikeRatio (default 1.5) and spikeMinIncrease (default 3 tokens/s).
// Before (0.4)
// anomalyConfig={{ spikeZScore: 4 }}
// After (0.5)
<AgentStat
agents={agents}
anomalyDetection
anomalyConfig={{ spikeRatio: 2, spikeMinIncrease: 5 }}
/>A new status: waiting
AgentStatusgains'waiting', so exhaustiveswitches need a case.- If you copied the
thrashBenignStatusesdefault, add'waiting'to it. AnomalyConfiggainswaitingStallMs; complete objects of that type need it (aPartial<AnomalyConfig>foranomalyConfigdoesn't).
import type { AgentStatus } from '@dan-build/agentstat';
function label(status: AgentStatus): string {
switch (status) {
case 'active': return 'Working';
case 'thinking': return 'Thinking';
case 'waiting': return 'Waiting'; // new in 0.5
case 'stuck': return 'Stuck';
case 'complete': return 'Done';
case 'hallucinating': return 'Hallucinating';
}
}AgentStatRef has new methods
Mocks typed as AgentStatRef need push and getStats.
Anomaly detection behaves differently
The detectors were rebuilt to stop false alarms (how it's measured). Expect fewer alerts: the stall limit while active is now 10 s, while thinking 30 s, and moving between working states isn't thrash. Each alert is one episode, with onAnomalyEnd when it ends.
0.3 → 0.4
hallucinationRisk and latencyTrend can be null
hallucinationRisk is null unless you pass confidenceScore or report 'hallucinating'; it used to default to an unmeasured 10%. latencyTrend is null until four latencyMs reports.
import type { HealthMetrics } from '@dan-build/agentstat';
function riskText(health: HealthMetrics): string {
// Before (0.3): `${health.hallucinationRisk}%` was always a number
return health.hallucinationRisk === null ? 'no signal' : `${health.hallucinationRisk}%`;
}Other changes
tokenEfficiencyfalls off relative to the band's upper edge instead of a fixed 4 points per token/s.- No backfilled history: each agent starts with one real sample instead of 80 invented ones.
- Colors:
createAgentanddemoAgentsno longer set a color; agents use the theme palette. onSpikeClickis renamedonPointClick. The old name still works.updateAgenttakes a partial sample:updateAgent(id, { tokensRate }). The positional form still works.