Repository navigation
fix(remote): report running for threads no share streams - #4310
Merged
Merged
Conversation
Saved-thread entries carry the desktop sidebar's status, pin, snooze, harness, model and scheduled job, and their project is the one the sidebar files them under. list_projects lists every project, subscribe_saved_sessions pushes saved_sessions_changed frames, and create_session accepts any listed project's folder.
The engine running a turn holds advisory locks on turn.lock and wait.lock in the thread's directory; the gateway probes them for a thread outside the live list, so a turn beyond the desktop's 32 shares no longer reads as idle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #4309. That PR shows a saved thread as
runningorneeds_inputonly while it is in the gateway's live list. The desktop shares at most 32 threads at once, so a turn running in any other thread showed asidleon the phone.The engine that runs a turn now holds an advisory lock on
turn.lockin the thread's directory while the turn runs, and onwait.lockwhile an approval or question waits (sessions/activity.rs, driven fromthread_status's live turn and wait counts). The gateway checks these locks for any thread outside the live list. The kernel releases a lock when its process exits, crashes included, so a lock left behind by a dead process reads as free. A settled thread still readsdone, and a shared thread's own activity still takes precedence.The wire format is unchanged. The README's description of
statusis updated, and the known-gap bullet is removed.This branch is built on #4309's commit because the gateway code it changes lives there. Merging this PR also lands #4309.
Changelog
Paired devices see a thread's turn as running even when the desktop is not sharing that thread.
Testing
cargo check --workspace --tests,cargo fmt --all -- --check,scripts/check-comments.py,scripts/check-rust-size.py.running/needs_inputfrom the locks, lets a share's own activity win, treats a released lock as free, and keeps a settled threaddone.