Skip to content

Linked machines: faster polling and background-work detection; release v1.2.2 - #28

Merged
hsalazr merged 4 commits into
mainfrom
t3/linked-machine-background-work
Nov 11, 2026
Merged

hsalazr merged 4 commits into
mainfrom
t3/linked-machine-background-work

Conversation

@hsalazr

@hsalazr hsalazr commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

This PR now carries the whole 1.2.2 patch: the faster polling from #27 (same commit, unchanged), the background-work detection, and the version bump. #27 is closed in favour of this one, so the release needs one CI run and one merge.

What changes for linked machines

Faster polling (was #27)

  • A machine with something running is asked every 3 s instead of 10. An idle or failing one stays at 10 s. Each machine has its own clock, counted from when its last answer came back, so a slow link is never asked faster than it answers.
  • When a top-level thread leaves a machine's active list, its recent roots are fetched in the same round. A finished run turns green at that poll. Before, the key could keep showing it as working, or drop off the deck, for up to 30 s.

A finished thread still held by background work shows as working

  • t3_thread_list says completed as soon as a turn ends, also while the thread still waits on subagents or on a command its agent is waiting for. t3_thread_wait with untilDelegatedWorkSettled: true and timeoutMs: 1 answers that at once, with read access, through the link.
  • The plugin asks about each top-level thread that finished a run, once per run, at most 12 per round and 4 at a time, and again every round while the thread is held.
  • A held thread shows the white spinner and a background chip (Glance: the white stroke). When the work ends it goes through the same 30 s grace as a thread on this machine, then turns green.
  • The new lists and the answers are published together, so this machine's own poll can't show a held thread as done in between.
  • A machine that refuses the question is left alone for 10 minutes and shows as before.

Release

  • Version 1.2.2 in the manifest, package.json, the lockfile and PLUGIN_VERSION; the change log's entries move under [1.2.2]. npm run notices changed nothing.

Limits

  • The key can't say what the thread waits on, only that it does.
  • "Held" is T3 Code's own Waiting rule: subagents, delegated tasks, and commands or monitors the agent said it waits for. A command the agent just left running (a dev server) and a pull request watch don't count. This machine's keys show both.
  • fix(server): agents can see a thread's pending background work pingdotgg/t3code#33858 would put the task list into t3_thread_list. If it ships, this can read that and drop the extra calls.

Testing

  • npm test: 198 pass, 10 skipped, 0 fail. Typecheck, build and streamdeck validate pass.
  • Ten new tests in test/remotes.test.ts. The main ones fail with their change removed.
  • On the real deck (macOS, Stream Deck, T3 Code 0.1.7 on both machines), with commit 41a3c59 swapped into the installed plugin: a thread on the linked machine that waited on a background job showed the white ring, turned blue when it ran again, then green. The linked machine's server trace showed the plugin listing it every 3.1 s and asking about a thread only while that thread was held.
  • The last code commit (publishing lists and answers together) has unit tests but was not run on the deck.

…n at once

A machine with something running is asked for its active list every 3 s
instead of every 10 (idle or failing: still 10), each machine on its own
clock, counted from when its last answer came back. When a top-level
thread leaves the active list, the recent roots are fetched in the same
round, so a finished run no longer shows as working, or drops off the
deck, until the 30 s refresh.
…s as working

t3_thread_list says "completed" as soon as a turn ends, also while the
thread waits on subagents, delegated tasks or awaited commands. After each
poll of a linked machine, ask t3_thread_wait (untilDelegatedWorkSettled,
1 ms) about each newly finished root, and again every round while it is
held. Held roots get a stand-in background task, so the key shows the
white spinner and a "background" chip, and done once the work ends.
…ds its finished threads

The lists were stored before the questions about held threads came back.
This machine's own poll could redraw the keys in between and show a
thread that still waits on background work as done for a moment.
@hsalazr hsalazr changed the title Linked machines: a finished thread still held by background work shows as working Linked machines: faster polling and background-work detection; release v1.2.2 Nov 11, 2026
@hsalazr
hsalazr changed the base branch from t3/multi-environment-thread-detection to main November 11, 2026 19:10
@hsalazr
hsalazr merged commit beda614 into main Nov 11, 2026
5 of 6 checks passed
@hsalazr
hsalazr deleted the t3/linked-machine-background-work branch November 11, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant