agent-run-inspector 0.10.3 → 0.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-run-inspector",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "Local, read-only inspector for Claude Code and Codex CLI agent runs.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -262,8 +262,11 @@ export function buildSessionTree({ main, subagents = [], now }) {
262
262
  // a stopped teammate's file is still fresh, but a call it left open will never finish
263
263
  const doneMates = new Set(children.filter((c) => c.id.startsWith('ext:') && c.status !== 'running').map((c) => c.id));
264
264
  for (const c of children) if (c.status === 'running' && doneMates.has(c.parentId)) c.status = 'unknown';
265
+ // A run with a `parent` (Orca's one-call branch-name helper) has no card of its own: its calls go on the parent's
266
+ const into = new Map(parsed.filter((p) => p.f.parent && !p.entry.claimed).map((p) => [p.spanId, externalSpanId(p.f.parent)]));
267
+ for (const c of children) if (into.has(c.parentId)) c.parentId = into.get(c.parentId);
265
268
  for (const p of parsed) {
266
- if (p.entry.claimed) continue;
269
+ if (p.entry.claimed || into.has(p.spanId)) continue;
267
270
  const m = p.entry.meta;
268
271
  const last = p.entry.mtime ?? p.entry.lastTs;
269
272
  let status; let end = null;
@@ -136,7 +136,7 @@ function quickClaude(entry, store, now) {
136
136
  status: running ? 'running' : 'ok',
137
137
  // a bot waiting on its workers is the bot at work: Running, not Background
138
138
  ...(running && turnEnded && !bot ? { background: true } : {}),
139
- agentCount: 1 + entry.subs.length,
139
+ agentCount: 1 + entry.subs.filter((s) => !s.parent).length, // a helper run (with a parent) has no card
140
140
  totals, models,
141
141
  });
142
142
  }
package/web/card.js CHANGED
@@ -41,7 +41,7 @@ export function cardInfo(agent, calls, now, own = null) {
41
41
  modelForIcon: model ?? agent.name,
42
42
  status: statusKey(agent.status),
43
43
  task: agent.task ?? '',
44
- usd: own ? (own.priced > 0 ? own.usd : null) : priced.length ? priced.reduce((s, c) => s + c.cost.usd, 0) : null,
44
+ usd: own ? own.usd ?? null : priced.length ? priced.reduce((s, c) => s + c.cost.usd, 0) : null,
45
45
  durationMs: known(agent.start) && end != null ? Math.max(0, end - agent.start) : null,
46
46
  callCount: own ? own.modelCalls + own.toolCalls : calls.length,
47
47
  external: Boolean(agent.external),
package/web/graph.js CHANGED
@@ -19,7 +19,10 @@ export function ownTotals(agents, byAgent) {
19
19
  for (const a of agents) {
20
20
  const o = out.get(a.parentId);
21
21
  const t = byAgent[a.id];
22
- if (o && t) for (const k of ['modelCalls', 'toolCalls', 'usd', 'priced']) o[k] -= t[k] ?? 0;
22
+ if (!o || !t) continue;
23
+ o.modelCalls -= t.modelCalls ?? 0;
24
+ o.toolCalls -= t.toolCalls ?? 0;
25
+ if (o.usd != null) o.usd = Math.max(0, o.usd - (t.usd ?? 0)); // null: nothing priced
23
26
  }
24
27
  return out;
25
28
  }