Skip to content

fix(server): report unreachable state for remote tasks when peer link is down - #220

Open
nullStack65 wants to merge 1 commit into
release/native-0.1.10from
fix/clo-1092-remote-task-unreachable-state
Open

nullStack65 wants to merge 1 commit into
release/native-0.1.10from
fix/clo-1092-remote-task-unreachable-state

Conversation

@nullStack65

Copy link
Copy Markdown
Owner

Problem

When the peer link to a linked environment goes down, delegated remote tasks continued to report "running" indefinitely in both task_status and thread UI projections, leaving parents and founders unable to tell a live remote task from a lost peer connection (CLO-1092 / A-P2-06).

Fix

  • Contracts (packages/contracts): Added optional lastSeenAt and peerStatus ("reachable" | "unreachable") to OrchestrationV2RemoteTaskChild, added the internal delegated_task.remote.peer-status command, added "unreachable" as a non-terminal status to OrchestratorMcpDelegatedTaskStatus, and exposed optional lastSeenAt on OrchestratorMcpDelegateTaskResult.
  • Server (apps/server):
    • Tracked last successful peer contact (lastSeenAt) per remote task in RemoteDelegation (initialized at launch/follow-up and refreshed on contact) and added PeerUnreachableThreshold (default 2 minutes).
    • Marked tasks peerStatus: "unreachable" (updating both subagent and timeline turn item projections) once peer polls or task_status probes fail past the threshold, and returned status: "unreachable" with lastSeenAt from task_status.
    • Restored peerStatus: "reachable" and real remote status (running / terminal) automatically when the peer recovers, with no duplicate task launched.
  • Web & Mobile UI (packages/client-runtime, apps/web, apps/mobile): Added isRemoteTaskUnreachable and surfaced distinct warning "Unreachable" badges, lineage summary counts, and last-seen tooltips in web (ThreadRelationshipsControl, ThreadRelationshipIcon, V2LifecycleRow, SubagentTooltipContent) and mobile (threadAgentsPresentation, SubagentStatusDot, thread-subagent-group).

Verification

  • vp run typecheck: 41/41 packages passed
  • vp lint (19 changed files): 0 warnings, 0 errors
  • apps/server/src/peer/RemoteDelegation.test.ts (-t "unreachable"): 2/2 passed (plus 55/55 existing cases passed)
  • apps/server/src/orchestration-v2/RemoteDelegatedTask.test.ts: 5/5 passed
  • apps/server/src/mcp/OrchestratorMcpService.test.ts (-t "remote"): 7/7 passed
  • apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx: 14/14 passed (Chromium)
  • apps/mobile/src/features/threads/threadAgentsPresentation.test.ts: 28/28 passed

Deploy: fleet
Model: gemini-4-neon
Task: fix
Agent: antigravity
Lane: CLO-1092

…k drops

When a linked peer stops answering, delegated remote tasks previously kept
reporting `"running"` indefinitely across `task_status` and thread projections.

Track last successful peer contact (`lastSeenAt`) and peer reachability
(`peerStatus`) per remote task via a new `delegated_task.remote.peer-status`
orchestration command, report non-terminal `status: "unreachable"` with
`lastSeenAt` once peer polls fail past the staleness threshold, recover to the
real remote status without duplicating the task when the link returns, and
surface the unreachable/last-seen marker in web and mobile thread UIs.

Model: gemini-4-neon
Task: fix
Agent: antigravity
Lane: CLO-1092
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant