feat(server): title background-task work-log rows with the task name#3751
feat(server): title background-task work-log rows with the task name#3751t3dotgg wants to merge 2 commits into
Conversation
Task lifecycle events carry a human-readable description ("Typecheck
mobile app", "Watch round-3 CI and bots"), but ingestion labeled every
task.progress activity "Reasoning update" and task.completed rows lost
the name entirely because terminal notifications don't include it.
- Use the description as the task.progress summary and payload.title,
falling back to the old label when it trims empty.
- Remember descriptions per (threadId, taskId) in a bounded cache so
task.completed rows get a payload.title too. Lookups don't consume
the entry, keeping replayed terminal events titled; entries are swept
with the other per-thread caches on session exit.
- Mirror task.progress by emitting summary alongside detail on
task.completed so clients render "name - completion summary".
Server-only: clients already prefer payload.title/summary/detail when
labeling work-log rows, so no web or mobile changes are needed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 31c03e7. Configure here.
ApprovabilityVerdict: Needs human review New feature that adds caching infrastructure and modifies how task activities are titled/displayed in the work-log. While well-tested and self-contained, the introduction of new user-facing behavior and activity payload changes warrants human review. You can customize Macroscope's approvability policy. Learn more. |
The completion title lived only in the in-memory description cache, so a session exit sweep, server restart, or TTL/capacity eviction before the terminal event left the completion row untitled even though earlier task.started/task.progress activities were persisted with the name. Fall back to scanning the thread's persisted activities (newest first) when the cache misses, reusing the memoized thread detail load. Addresses review comments from cursor[bot] and macroscopeapp[bot]. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

What Changed
Background-task work-log rows are now titled with the task's actual name instead of generic labels.
task.progressactivities use the task description ("Typecheck mobile app") as their summary andpayload.titleinstead of "Reasoning update", andtask.completedactivities get apayload.titletoo, via a small per-(threadId, taskId) description cache in ingestion — terminal task notifications don't carry the name themselves.task.completedalso now emitspayload.summaryalongsidepayload.detail, mirroringtask.progress, so clients render "name - completion summary".Why
Providers stream named background work units (subagents, background shells, workflows), but the work log flattened them into anonymous "Reasoning update" / "Task completed" rows, making it impossible to tell what's actually running. The fix is confined to the provider-agnostic ingestion layer in
apps/server— clients already preferpayload.title/summary/detailwhen labeling rows, so web and mobile pick the names up with zero client changes and no provider-specific logic anywhere new.Edge cases covered: descriptions that trim empty fall back to the old labels; the cache is bounded (capacity + TTL), swept with the other per-thread caches on session exit, and lookups don't consume entries so replayed terminal events stay titled.
Tested via two new ingestion tests (named progress/completion, and completion titled from
task.startedalone); server orchestration suite passes 153/153, plus web session-logic and mobile threadActivity suites. Reviewed by two independent agent reviews; all findings addressed.Checklist
🤖 Generated with Claude Code
Note
Low Risk
Localized projection/activity shaping in ingestion with fallbacks and tests; no auth, API contract breaks, or client changes required.
Overview
Background-task work-log rows now show the provider’s task description instead of generic labels like “Reasoning update” or unnamed “Task completed”.
In
ProviderRuntimeIngestion, descriptions fromtask.started/task.progressare stored in a bounded per-(threadId, taskId)cache.task.progressuses the trimmed description for the activitysummaryandpayload.titlewhen present (otherwise the old “Reasoning update” label).task.completedgetspayload.titlefrom that cache, with a fallback that scans already-persistedtask.started/task.progressactivities when the cache was cleared (e.g.session.exited). Completion activities also setpayload.summaryandpayload.detailfrom the terminal summary, matchingtask.progressso clients can show “name — completion text” without app changes.Cache keys for the thread are invalidated alongside other per-session ingestion state on session exit; new ingestion tests cover named progress/completion, start-only naming, and post-sweep recovery.
Reviewed by Cursor Bugbot for commit 6485746. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Title background-task work-log rows with the task name in
ProviderRuntimeIngestiontask.progressactivities now use the task description as their summary and include apayload.titlefield;task.completedactivities include apayload.titlesourced from previously seen descriptions, pluspayload.summaryandpayload.detailwhen a completion summary is available.threadId+taskId) whentask.startedortask.progressevents are ingested, and the cached title is passed intoruntimeEventToActivitiesat completion time.session.exitedevent, the title is recovered by scanning persistedOrchestrationThreadActivityentries in reverse order via the newfindTaskTitleInActivitieshelper.clearTurnStateForSessionnow also invalidates task description cache entries for the thread alongside other per-thread caches.Macroscope summarized 6485746.