Mobile QoL: remote project add, auto-refresh, and daemon-restart recovery#455
Mobile QoL: remote project add, auto-refresh, and daemon-restart recovery#455Crabbotix wants to merge 3 commits intoDimillian:mainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd5b109622
ℹ️ 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".
| if (connectionStateRef.current === "live") { | ||
| lastThreadEventAtRef.current = Date.now(); |
There was a problem hiding this comment.
Mark stream live on activity events
Gating lastThreadEventAt updates behind connectionStateRef.current === "live" means the hook now relies on thread/live_heartbeat to ever enter/maintain live mode, but the in-repo backends currently emit attach/detach only (see src-tauri/src/codex/mod.rs and src-tauri/src/bin/codex_monitor_daemon.rs thread/live_attached/thread/live_detached paths) and no heartbeat producer. In that environment the state can stay stuck in polling, so the stale watchdog (connectionStateRef.current === "live") never triggers after daemon interruptions and live-recovery logic is effectively bypassed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 2f35d4b.
What changed:
- In
useRemoteThreadLiveConnection, thread activity events (item/*,turn/*,error,thread/tokenUsage/updated) now updatelastThreadEventAtRefand set connection state to"live". - Added regression test:
promotes polling state to live on thread activity without heartbeat.
Validation run:
npm run test -- src/features/app/hooks/useRemoteThreadLiveConnection.test.tsx src/features/app/hooks/useRemoteThreadRefreshOnFocus.test.tsx src/features/workspaces/hooks/useWorkspaceRefreshOnFocus.test.tsx src/features/workspaces/hooks/useWorkspaces.test.tsx src/features/app/components/Sidebar.test.tsxnpm run typecheck
|
Addressed a follow-up reconnect-churn risk from RepoPrompt review in commit 274d092. Change summary:
Validation run:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 274d092bc5
ℹ️ 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".
| if (isDocumentVisible() && isWindowFocused()) { | ||
| void reconnectLive(activeWorkspaceId, selectedThreadId, { | ||
| runResume: true, |
There was a problem hiding this comment.
Ignore self-triggered detach events before reconnecting
This unconditional reconnect on thread/live_detached fires even when the detach was initiated locally by reconnectLive itself (the dedupe path now calls threadLiveUnsubscribe before re-subscribing for the same key). In a visible/focused window, that unsubscribe emits thread/live_detached, which re-enters reconnectLive and creates overlapping reconnect sequences for the same thread, causing redundant resume/subscribe calls and racey state transitions instead of a single reconnect attempt.
Useful? React with 👍 / 👎.
What
Why
How
Testing status