fix: daemon-health identity race + Orchestration sub-tab follow-ups - #5085
Conversation
- AppRoutes: add privacy-safe entry/exit diagnostics to OrchestrationRedirect (allowlisted branch ids + session-presence only) and cover it with a new OrchestrationRedirect.test.tsx exercising every mapping branch. - LocalAIDownloadSnackbar: treat an empty-but-successful RPC response as transient, not "download complete", so a soft failure no longer freezes the fast poll for the rest of the download. - daemonHealthService: resolve the health-store user from the refresh's own sessionToken passed by CoreStateProvider, not the deferred non-React store (commitState writes it inside a React setState updater) — fixes health being filed under the prior/__pending__ user during an identity flip. Add privacy-safe watchdog/ingest diagnostics. - json_rpc_e2e: assert health.updated_at in the RPC contract test (the frontend rejects the payload without it).
Folding Orchestration under Brain mounted the full Brain component for /brain?tab=orchestration (and the redirected /orchestration), whose effect unconditionally called memoryTreeGraphExport on mount + memory-tree events — an unrelated graph RPC the standalone Orchestration page never issued. Gate the effect off when the orchestration tab is active (re-running when returning to a graph-bearing tab). Addresses Codex review on PR tinyhumansai#5080.
Brain calls useSubconscious() unconditionally, which fires subconsciousStatus / openhumanHeartbeatSettingsGet and installs a 5s poll. Folding Orchestration under Brain meant opening Brain > Orchestration (and the redirected /orchestration) now kept those unrelated heartbeat/subconscious RPCs running — which the standalone OrchestrationPage never did. Add an `enabled` param to useSubconscious (default true, back-compat) that skips the initial fetch + poll when false, and pass `activeTab === 'subconscious'` from Brain. The status is consumed only on that tab. Addresses Codex review on PR tinyhumansai#5080.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
Comment |
Summary
Follow-up review fixes on top of #5075 (the Orchestration-under-Brain fold +
daemon-health/local-AI cleanup, already merged to
main). These were surfacedby CodeRabbit/Codex review of the superseded #5080 and are not on
main:refresh's own
sessionToken(passed byCoreStateProvider) instead of thedeferred non-React snapshot store —
commitStatewrites that store inside aReact
setStateupdater, so reading it at ingest time filed health under theprior /
__pending__user during a login/identity flip. Add privacy-safewatchdog + ingest diagnostics.
transient, not "download complete", so a soft failure no longer freezes the
fast poll for the rest of the download.
memoryTreeGraphExportfetch and gateuseSubconsciouspolling (newenabledparam) off the Orchestration sub-tab,so opening
/brain?tab=orchestration(and the redirected/orchestration)no longer starts unrelated graph / heartbeat RPCs the standalone page never
issued.
OrchestrationRedirect+ a newOrchestrationRedirect.test.tsxcovering everymapping branch.
health.updated_atinjson_rpc_e2e(thefrontend rejects the payload without it).
Problem
#5075 shipped the fold + poll consolidation, but review flagged a real
identity-flip data-integrity race, a poll-freeze soft-failure, two unrelated
RPC loops newly triggered on the Orchestration sub-tab, and a couple of missing
diagnostics / assertions. None landed on
main.Solution
Small, targeted fixes with regression tests for each; no behaviour change to the
orchestration surfaces themselves.
Submission Checklist
OrchestrationRedirect.test.tsx, the Brain orchestration-tab tests, theuseSubconsciousdisabled-path test, and the daemon-health ingest tests; the full gate is enforced by CI.docs/TEST-COVERAGE-MATRIX.mdfeature rows change.Impact
flips; download progress no longer freezes on a soft RPC failure; the
Orchestration sub-tab stops two unrelated background RPC loops. No migration,
security, or API-surface changes.
Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/daemon-health-and-orch-followupsa7a2520abValidation Run
pnpm --filter openhuman-app format:checkpnpm typecheckOrchestrationRedirect,Brain,useSubconscious,daemonHealthService,CoreStateProvider,LocalAIDownloadSnackbar(68 passing)cargo fmt --all --check(json_rpc_e2e assertion only)Validation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
useSubconsciousdefaults toenabledfor all existing callers.getUserId(tokenOverride)falls back to the store when no token is passed;useSubconscious(enabled=true)default keeps Activity + other callers unchanged.Duplicate / Superseded PR Handling