Skip to content

feat(server): title background-task work-log rows with the task name#3751

Open
t3dotgg wants to merge 2 commits into
mainfrom
task-work-log-names
Open

feat(server): title background-task work-log rows with the task name#3751
t3dotgg wants to merge 2 commits into
mainfrom
task-work-log-names

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 6, 2026

Copy link
Copy Markdown
Member

What Changed

Background-task work-log rows are now titled with the task's actual name instead of generic labels. task.progress activities use the task description ("Typecheck mobile app") as their summary and payload.title instead of "Reasoning update", and task.completed activities get a payload.title too, via a small per-(threadId, taskId) description cache in ingestion — terminal task notifications don't carry the name themselves. task.completed also now emits payload.summary alongside payload.detail, mirroring task.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 prefer payload.title/summary/detail when 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.started alone); server orchestration suite passes 153/153, plus web session-logic and mobile threadActivity suites. Reviewed by two independent agent reviews; all findings addressed.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

🤖 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 from task.started / task.progress are stored in a bounded per-(threadId, taskId) cache. task.progress uses the trimmed description for the activity summary and payload.title when present (otherwise the old “Reasoning update” label). task.completed gets payload.title from that cache, with a fallback that scans already-persisted task.started / task.progress activities when the cache was cleared (e.g. session.exited). Completion activities also set payload.summary and payload.detail from the terminal summary, matching task.progress so 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 ProviderRuntimeIngestion

  • task.progress activities now use the task description as their summary and include a payload.title field; task.completed activities include a payload.title sourced from previously seen descriptions, plus payload.summary and payload.detail when a completion summary is available.
  • Task descriptions are cached in-memory (keyed by threadId+taskId) when task.started or task.progress events are ingested, and the cached title is passed into runtimeEventToActivities at completion time.
  • When the in-memory cache has been swept by a session.exited event, the title is recovered by scanning persisted OrchestrationThreadActivity entries in reverse order via the new findTaskTitleInActivities helper.
  • clearTurnStateForSession now also invalidates task description cache entries for the thread alongside other per-thread caches.

Macroscope summarized 6485746.

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>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e727c5cb-3e0a-49a6-bc91-cea8fec260c5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-work-log-names

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 6, 2026
Comment thread apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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>
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant