fix: do not treat unknown presence as machine offline - #486
fix: do not treat unknown presence as machine offline#486slashdevcorpse wants to merge 4 commits into
Conversation
getOnlineMachineIds() null means the presence room did not join. MCP and chat landing no longer map that to MACHINE_OFFLINE.
Also treat the local probe machine as online on chat landing so a live PC is not labeled offline after presence has synced.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 844c3759dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| onlineMachineIds.has(machineId as MachineId) || | ||
| presenceSyncState !== 'synced', |
There was a problem hiding this comment.
Include unknown machines in the mobile selector
When presence is not synced on Web/mobile, this callback makes hasNoMachine false and populates selectableMachines from cached machines, but mobileSheetMachineOptions is still sourced from useOnlineMachines() at chat-landing.tsx:3859, which filters strictly to heartbeat IDs in hooks/use-online-machines.ts:23-25. The mobile sheet therefore renders an enabled, non-loading Machine picker with no options, preventing users from choosing or switching to the live remote PC in the exact missing-presence-join scenario this change is intended to support.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 498e148. mobileSheetMachineOptions now maps selectableMachines (same source as the desktop picker and hasNoMachine) instead of heartbeat-only useOnlineMachines().
Unknown presence already populates selectableMachines. The mobile picker was still filtered to heartbeat IDs via useOnlineMachines. Model: grok-4.6
Related issue
Closes #484
Problem / pressure
getOnlineMachineIds()returningnullmeans the presence room did not join. MCP and chat landing treated that as every remote machine offline, including a live PC.Summary
MCP
makeMachineOnlineLookupForMcpand create-options treatnullas unknown (usable). Chat landing treats the local probe machine as online, and only claims Offline when presence issyncedand there is no heartbeat. Does not sweep other.has()surfaces.Before / after
MACHINE_OFFLINEand hidden machines.has()→ Offline while syncing.syncedand the heartbeat is missing.Test plan
corepack pnpm exec vitest run src/mcp/lody-mcp-server.test.ts -t "MACHINE_OFFLINE|shares one remote Machine presence"— 2 passed.Context handoff
Instructions for reviewing agents
makeMachineOnlineLookupForMcpinlody-mcp-server.tsandisPresenceMachineOnlineinchat-landing.tsx..has()surfaces (sidebar, settings) are unchanged.Authoring context
machine list. Live presence-join failure.