Two surfaces answer "when was this agent last active" from the same runtime fields with different rules, so they can report different values for the same agent.
src/renderer/src/features/tldr/freshness.ts (tldrActivity, drives the TLDR peek footer): max(lastJsonlEntryAt, phaseChangedAt, turnStartedAt, submittedAt), with a transcript-tail fallback that accepts any entry type.
src/renderer/src/workspace/agentManagementMcp.ts (runtimeActivityAt ~line 93, latestVisibleTimestamp ~line 422, drives the agent_management MCP inventory): max(phaseChangedAt, turnStartedAt, submittedAt) — no lastJsonlEntryAt — with a tail fallback that accepts only user/assistant entries carrying non-empty text.
Expected: one derivation, so the TLDR footer and the MCP inventory agree.
Actual: they diverge when the newest transcript entry is a tool or system record and lastJsonlEntryAt is null. The footer reports the tool record's time; the inventory skips it and reports an older turn (or nothing).
Impact: cosmetic in the UI, but the agent_management inventory is what an orchestrating agent reads to decide whether a child is idle, and close_old_agents-style reasoning depends on the same notion of activity. Low severity, real inconsistency.
Found while reviewing #912 (PR for #904), which added tldrActivity. Not fixed there because unifying them changes agent_management tool output for existing callers, which is outside that issue's scope.
Suggested fix: export one helper (the freshness rule is the better one — it includes the ingest watermark) and have descriptorForSession call it. Regression test: a runtime whose newest entry is tool-only, asserting both surfaces report the same timestamp.
Two surfaces answer "when was this agent last active" from the same runtime fields with different rules, so they can report different values for the same agent.
src/renderer/src/features/tldr/freshness.ts(tldrActivity, drives the TLDR peek footer):max(lastJsonlEntryAt, phaseChangedAt, turnStartedAt, submittedAt), with a transcript-tail fallback that accepts any entry type.src/renderer/src/workspace/agentManagementMcp.ts(runtimeActivityAt~line 93,latestVisibleTimestamp~line 422, drives theagent_managementMCP inventory):max(phaseChangedAt, turnStartedAt, submittedAt)— nolastJsonlEntryAt— with a tail fallback that accepts onlyuser/assistantentries carrying non-empty text.Expected: one derivation, so the TLDR footer and the MCP inventory agree.
Actual: they diverge when the newest transcript entry is a tool or system record and
lastJsonlEntryAtis null. The footer reports the tool record's time; the inventory skips it and reports an older turn (or nothing).Impact: cosmetic in the UI, but the
agent_managementinventory is what an orchestrating agent reads to decide whether a child is idle, andclose_old_agents-style reasoning depends on the same notion of activity. Low severity, real inconsistency.Found while reviewing #912 (PR for #904), which added
tldrActivity. Not fixed there because unifying them changesagent_managementtool output for existing callers, which is outside that issue's scope.Suggested fix: export one helper (the freshness rule is the better one — it includes the ingest watermark) and have
descriptorForSessioncall it. Regression test: a runtime whose newest entry is tool-only, asserting both surfaces report the same timestamp.