feat(server): server-stamped task data shapes (stacked on #5219) #5316
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits into
t3code/native-subagent-observability fromrefs/pull/5316/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -554,4 +565,10 @@554565 case "task.progress": {555566 return [556567 {557- id: event.eventId,568+ // Stable per-task id: progress is "latest state", not history, so569+ // each tick REPLACES the last via the activity upsert (PK + the570+ // replace-by-id apply in projector and client reducer). Keeps one571+ // progress row per task instead of thousands, so a large fleet's572+ // ticks can no longer evict its own start/terminal rows out of573+ // the 500-row retention window.574+ id: EventId.make(`task-progress:${event.payload.taskId}`),
- @@ -314,4 +316,13 @@314316 * client folds survive activity retention; absent fields stay absent.315317 */316318 function taskLinkageActivityFields(payload: Record<string, unknown>): Record<string, unknown> {317- const fields: Record<string, unknown> = {};319+ const fields: Record<string, unknown> = {320+ // Server-stamped classification: persisted rows are self-describing, so321+ // clients trust the stamp instead of re-deriving agent-vs-background322+ // from taskType denylists and marker heuristics (legacy rows without a323+ // stamp keep the client fallback).324+ agentKind: classifyTaskAgentKind({325+ taskType: typeof payload.taskType === "string" ? payload.taskType : undefined,326+ agentId: typeof payload.agentId === "string" ? payload.agentId : undefined,327+ }),328+ };@@ -554,4 +565,10 @@554565 case "task.progress": {555566 return [556567 {557- id: event.eventId,568+ // Stable per-task id: progress is "latest state", not history, so569+ // each tick REPLACES the last via the activity upsert (PK + the570+ // replace-by-id apply in projector and client reducer). Keeps one571+ // progress row per task instead of thousands, so a large fleet's572+ // ticks can no longer evict its own start/terminal rows out of573+ // the 500-row retention window.574+ id: EventId.make(`task-progress:${event.payload.taskId}`),
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -133,21 +117 @@133- * roster (review finding: old "tailing logs" tasks appeared as running134- * subagents after upgrading). Every new emitter marks its rows: Claude135- * repeats linkage (role/model/toolUseId) on all task.* rows, workflow136- * members carry parentAgentId/agentIndex, Codex children carry137- * timelineBypass/agentPath.138- */139-function hasAgentPipelineMarker(payload: Record<string, unknown>): boolean {140- return (141- payload.timelineBypass === true ||142- typeof payload.role === "string" ||143- typeof payload.model === "string" ||144- typeof payload.parentAgentId === "string" ||145- typeof payload.agentPath === "string" ||146- typeof payload.workflowName === "string" ||147- typeof payload.toolUseId === "string" ||148- typeof payload.agentIndex === "number"149- );150-}151-152-/** True when this activity's payload describes a non-agent background task. */153117 export function isBackgroundTaskActivity(payload: Record<string, unknown>): boolean {
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
48483c3e-2a87-4448-8be1-1c54860e037bYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share