Skip to content

fix(remote): report running for threads no share streams - #4310

Merged
LHagfoss merged 2 commits into
mainfrom
fix/remote-running-status-unshared
Nov 24, 2026
Merged

LHagfoss merged 2 commits into
mainfrom
fix/remote-running-status-unshared

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Follow-up to #4309. That PR shows a saved thread as running or needs_input only 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 as idle on the phone.

The engine that runs a turn now holds an advisory lock on turn.lock in the thread's directory while the turn runs, and on wait.lock while an approval or question waits (sessions/activity.rs, driven from thread_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 reads done, and a shared thread's own activity still takes precedence.

The wire format is unchanged. The README's description of status is 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.
  • New tests:
    • The engine's locks follow the turn and wait counts and are freed when they reach zero.
    • The gateway reports running/needs_input from the locks, lets a share's own activity win, treats a released lock as free, and keeps a settled thread done.
  • Tests run in CI.

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.
@github-actions github-actions Bot added the fix A bug fix label Nov 24, 2026
@LHagfoss
LHagfoss merged commit 35c43c0 into main Nov 24, 2026
7 checks passed
@LHagfoss
LHagfoss deleted the fix/remote-running-status-unshared branch November 24, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant