Skip to content

sync: port upstream native subagent & workflow observability (#5219) - #214

Merged
cursor[bot] merged 4 commits into
mainfrom
codex/sync-20260806-l8-subagent-obs-63f7
Aug 6, 2026
Merged

sync: port upstream native subagent & workflow observability (#5219)#214
cursor[bot] merged 4 commits into
mainfrom
codex/sync-20260806-l8-subagent-obs-63f7

Conversation

@aaditagrawal

Copy link
Copy Markdown
Owner

Catch-up after upstream moved during the v0.0.32 release.

What lands

Fork deviations preserved

  • ChatView keeps fork rateLimitThreads alongside new agentPanelModel
  • Session-logic tests keep fork PROVIDER_OPTIONS while adding upstream subagent coverage
  • Provider runtime tests keep fork RuntimeEventRaw helpers with upstream classifyTaskAgentKind

Ancestry

Includes git merge -s ours upstream/main so upstream/main is again an ancestor (0 unique commits behind).

Verification

vp check and vp run typecheck pass; focused suites 134/134.

Open in Web Open in Cursor 

t3dotgg and others added 4 commits August 6, 2026 00:32
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit a2ca89a)
Keep fork provider catalog/rate-limit surfaces and RuntimeEventRaw
coverage while formatting the merged providerRuntime test imports.

Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>
…ility)

Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@aaditagrawal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c2eb9ea7-e19c-4fda-8326-52113f352d15

📥 Commits

Reviewing files that changed from the base of the PR and between 907d8f6 and 1dbfe48.

📒 Files selected for processing (46)
  • apps/mobile/src/lib/threadActivity.test.ts
  • apps/mobile/src/lib/threadActivity.ts
  • apps/server/integration/OrchestrationEngineHarness.integration.ts
  • apps/server/src/auth/RpcAuthorization.ts
  • apps/server/src/orchestration/ActivityPayloadProjection.test.ts
  • apps/server/src/orchestration/Layers/CheckpointReactor.test.ts
  • apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts
  • apps/server/src/orchestration/Layers/ProjectionPipeline.test.ts
  • apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.ts
  • apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
  • apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts
  • apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts
  • apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
  • apps/server/src/orchestration/ThreadBackgroundLiveness.test.ts
  • apps/server/src/orchestration/ThreadBackgroundLiveness.ts
  • apps/server/src/orchestration/runtimeLayer.ts
  • apps/server/src/orchestration/workflowScriptQuery.test.ts
  • apps/server/src/orchestration/workflowScriptQuery.ts
  • apps/server/src/provider/Layers/ClaudeAdapter.test.ts
  • apps/server/src/provider/Layers/ClaudeAdapter.ts
  • apps/server/src/provider/Layers/CodexAdapter.ts
  • apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts
  • apps/server/src/provider/Layers/CodexCollabWire.test.ts
  • apps/server/src/provider/Layers/CodexSessionRuntime.ts
  • apps/server/src/provider/testFixtures/codexCollabMockPeer.mjs
  • apps/server/src/provider/testFixtures/codexCollabMockPeer.sh
  • apps/server/src/provider/testFixtures/codexMultiAgentWire.json
  • apps/server/src/ws.ts
  • apps/web/src/components/AgentsPanel.tsx
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/RightPanelTabs.tsx
  • apps/web/src/components/Sidebar.logic.ts
  • apps/web/src/components/SidebarV2.tsx
  • apps/web/src/components/chat/MessagesTimeline.logic.ts
  • apps/web/src/components/chat/MessagesTimeline.tsx
  • apps/web/src/rightPanelStore.ts
  • apps/web/src/session-logic.test.ts
  • apps/web/src/session-logic.ts
  • packages/client-runtime/package.json
  • packages/client-runtime/src/state/orchestration.ts
  • packages/client-runtime/src/state/subagentRuntime.test.ts
  • packages/client-runtime/src/state/subagentRuntime.ts
  • packages/contracts/src/orchestration.ts
  • packages/contracts/src/providerRuntime.test.ts
  • packages/contracts/src/providerRuntime.ts
  • packages/contracts/src/rpc.ts

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

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:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). labels Aug 6, 2026
@cursor
cursor Bot merged commit 911276d into main Aug 6, 2026
12 checks passed
@cursor
cursor Bot deleted the codex/sync-20260806-l8-subagent-obs-63f7 branch August 6, 2026 06:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1dbfe4850d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +545 to +555
export function classifyTaskAgentKind(input: {
readonly taskType?: string | undefined;
readonly agentId?: string | undefined;
}): "agent" | "background" {
const { taskType, agentId } = input;
const nonAgentType =
taskType !== undefined && (MONITOR_TASK_TYPES.has(taskType) || INERT_TASK_TYPES.has(taskType));
if (agentId !== undefined && agentId.trim().length > 0) {
return taskType === undefined || nonAgentType ? "background" : "agent";
}
return nonAgentType ? "background" : "agent";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep executable classification out of the contracts package

Move classifyTaskAgentKind and its mutable classification sets into a runtime package such as @t3tools/shared; adding executable provider-classification logic here breaks the repository's explicit requirement that packages/contracts remain schema-only and makes consumers load application behavior from the contract boundary.

AGENTS.md reference: AGENTS.md:L75-L75

Useful? React with 👍 / 👎.

}
const truncated = stat.size > SCRIPT_BYTE_CAP;
const buffer = Buffer.alloc(Math.min(stat.size, SCRIPT_BYTE_CAP));
const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Read until the requested script bytes are filled

When the script resides on a filesystem that returns a short positional read, FileHandle.read may report fewer bytes than the requested buffer without reaching EOF. This single call then returns incomplete script contents while truncated remains false, so the viewer silently presents a partial file; loop until the buffer is filled or EOF is reached.

Useful? React with 👍 / 👎.

Comment on lines +659 to +662
roster = roster
.slice()
.sort((a, b) => rank(a) - rank(b) || b.updatedAt.localeCompare(a.updatedAt))
.slice(0, ROSTER_LIMIT);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve workflow coordinators when capping the roster

A supported 100-member Claude workflow produces 101 roster entries once its coordinator is included. Because the coordinator progress row is processed before the synthesized member rows, this active-only timestamp sort typically makes the coordinator the oldest entry and slices it out; deriveAgentPanelModel then has no workflow ID to group against, so all members appear as orphaned direct agents and the phase/script workflow UI disappears. Preserve coordinators or apply the cap only to leaf agents.

Useful? React with 👍 / 👎.

settledCount,
totalTokens,
hasAgents: true,
liveCount: runningCount + waitingCount,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude workflow coordinators from displayed agent counts

For every live workflow, this total counts both the coordinator task and each member as an agent. ChatView uses liveCount to render “N agents working,” so a five-member workflow is reported as six agents, and the panel footer is inflated the same way; derive agent counts from direct and workflow-member rows while tracking coordinator liveness separately.

Useful? React with 👍 / 👎.

// don't slide.
return;
}
if ((wasTerminal || agent.status === "idle") && (status === "running" || status === "pending")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat waiting as a new agent activation

When an idle Codex child is resumed and its first thread/status/changed patch reports waitingOnApproval or waitingOnUserInput, the adapter emits waiting before turn/started; this condition does not treat that transition as reactivation. The following running patch also misses because the prior status is now waiting, leaving the new activation with the previous run's count, timer, result, and error. Include waiting in the active reactivation path.

Useful? React with 👍 / 👎.

Comment on lines +3246 to +3247
case "task_notification": {
context.liveTaskIds.delete(message.task_id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Release completed Claude task bookkeeping

In a long-lived Claude session, every completed subagent remains in taskAgents, and every workflow slot remains in workflowMemberFingerprints; only liveTaskIds is cleared here. Repeated turns therefore grow these maps without bound, while each attributed stream block also linearly scans all historical taskAgents, causing steadily increasing memory use and attribution latency. Prune terminal task metadata and its workflow fingerprints after emitting the final event, or maintain bounded/reverse indexes.

Useful? React with 👍 / 👎.

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

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). 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.

3 participants