Skip to content

bug(agents): TLDR footer and Agent Management MCP derive last-active differently #915

Description

@Juliusolsson05

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions