Repository navigation
Conversation
…fetches, thread-find skills TX, and visit/activity churn
There was a problem hiding this comment.
🟡 Medium
A failed non-open visit still waits up to 60 seconds to retry after reconnect, leaving the read watermark stale if the user leaves first. Once the 10-second retry cooldown expires, onShell reaches the ordinary dispatch check, which still requires elapsed >= VISIT_DISPATCH_THROTTLE_MS; let retryPending bypass that streaming throttle.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @packages/client-runtime/src/state/threadVisits.ts around line 284:
A failed non-open visit still waits up to 60 seconds to retry after reconnect, leaving the read watermark stale if the user leaves first. Once the 10-second retry cooldown expires, `onShell` reaches the ordinary dispatch check, which still requires `elapsed >= VISIT_DISPATCH_THROTTLE_MS`; let `retryPending` bypass that streaming throttle.
| return; | ||
| } | ||
| if ( | ||
| !payload.focused && |
There was a problem hiding this comment.
🟡 Medium lib/backgroundActivityReporter.ts:456
A visible tab can stop scope work from t=120s to t=149s: a peer report sent at t=0 still satisfies hasPeerCoverage at t=74s, so this tab skips its report until the next 75s tick, even if the peer's renewal fails. The server lease expires after 120s, so schedule a takeover before the peer lease expires or only skip when coverage lasts through the next tick.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/web/src/lib/backgroundActivityReporter.ts around line 456:
A visible tab can stop scope work from t=120s to t=149s: a peer report sent at t=0 still satisfies `hasPeerCoverage` at t=74s, so this tab skips its report until the next 75s tick, even if the peer's renewal fails. The server lease expires after 120s, so schedule a takeover before the peer lease expires or only skip when coverage lasts through the next tick.
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The PR reduces projection and search payloads while changing default activity-reporting, lease, and read-state update timing. Those default changes require human review of the freshness and background-work tradeoffs. Needs human approval because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosNo All 64 scenario measurements
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Client-side mutations and background coordinators currently send unnecessary RX and TX traffic: composer sends and subagent/checkpoint actions fetch entire
getThreadProjectionsnapshots when they only need a small slice,searchThread/searchThreadStreamupload the full skills list on every keystroke,thread.visitfires every 10s during streaming turns, andbackgroundActivityReportersends redundant 45s keepalives across every open browser tab and unchanged environment.Stacked on #48446 (
nbr/config-opt). This change cuts redundant RX/TX wire traffic across server, client-runtime, Web/Desktop, and Mobile while keeping all wire changes opt-in and backwards-compatible:getThreadProjectionslices (orchestrationV2.ts,ws.ts,commands.ts,useComposerSend.ts,ChatView.tsx): add optionalfields,subagentId, andomitCheckpointFilestogetThreadProjection(routing lightweight slices throughgetThreadRecordswithout materializing full bounded snapshots) and reuse the existing in-memory thread inuseComposerSend.ws.ts,server.ts,threadFind.ts,useThreadFind.ts): advertisethreadFindServerSkillsinServerConfigand let the server resolve provider skills forsearchThread/searchThreadStreamwhen omitted by newer clients, eliminating per-keystroke skill TX while preserving explicit client overrides.thread.visit(threadVisits.ts): raise streaming heartbeat cadence from 10s to 60s while preserving immediate 0ms dispatch on thread open, unseen completion, and wake/focus, plus 10s failure retry.backgroundActivityReporter(apps/web/src/lib/backgroundActivityReporter.ts,apps/mobile/src/connection/background-activity.ts): raise foreground/background cadence to 75s/120s, skip unchanged environments within a 25s window, pause hidden tabs, re-report immediately on WebSocket reconnect viaSupervisorConnectionState.generation, and dedupe visible tabs overBroadcastChannelwith immediate release/scope-change takeover.Verified with
vp run check:changed(format, lint, knip, graphql, 39-package typecheck, 28 test files / 508 tests, React Compiler coverage).Created with Gemini 4 Neon in Antigravity.