Add targeted restore-token reset control - #36
Open
minpeter wants to merge 15 commits into
Open
Conversation
Let control clients clear one target's Wayland portal restore token and reconnect it without rewriting other credentials. Preserve receiver ports and reject shared capture groups so unrelated streams stay intact. Co-authored-by: minpeter <minpeterx@gmail.com> Generated with [OpenAI Codex](https://openai.com/codex/)
Reserve the active capture generation while credential I/O runs outside the daemon mutex, keep the original stream intact on persistence failure, reject peer joins during reset, and report disconnect or shutdown races accurately. Co-authored-by: minpeter <minpeterx@gmail.com> Generated with [OpenAI Codex](https://openai.com/codex/)
Exercise the public command through its real process boundary, verify the exact Unix-socket request, and reject invalid arity before daemon contact. Co-authored-by: minpeter <minpeterx@gmail.com> Generated with [OpenAI Codex](https://openai.com/codex/)
minpeter
marked this pull request as ready for review
August 28, 2026 10:53
minpeter
marked this pull request as draft
August 28, 2026 12:28
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
minpeter
marked this pull request as ready for review
August 28, 2026 18:30
omarroth
added a commit
that referenced
this pull request
Sep 9, 2026
The shared encoded queue checked the duration after adding the incoming frame, rejecting one picture before Apple's producer admission threshold. Check existing queued duration >= 67 ms instead. At 30 fps, two pending pictures occupy 66.7 ms, so a third is admitted and the fourth is rejected. Grounding: artifacts/26A5388g__MacOS/decompiled/AirPlaySender.c, vdsink_ShouldDropFrame (128485-128526). The queue is created at 188416, passed to APVirtualDisplaySinkCreate at 188571, and consumed by screenstream_dequeueAndProcessSampleBuffer at 319674. It holds encoded CMSampleBuffers. The byte/chunk bounds and shared-sink detachment policy remain unchanged; this does not port Apple's producer-feedback mechanism or resolve longer stalls reported in PR #36. Tests: failing-first 20/30/60 fps admission regressions, exact 67 ms equality, drain/re-enqueue ordering, byte/chunk bounds, and oversized-first-frame rejection. Full race suite, vet, and executable builds passed before commit.
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.
Summary
reset-restore-token <target>to the daemon socket, Go client, anddoubletake-ctlMotivation
Omarchy control surfaces need a first-class way to re-open the Wayland source picker. Editing the credential store from a helper script is racy and can discard pairing state, so the daemon should own this lifecycle transition.
Consumed by glennbarosen/omarchy-airplay#1, which uses this command to expose source switching from the Omarchy bar.
Extended physical-TV QA also showed that the original one-process Wayland pipeline retained portal-backed buffers across conversion and encoding. That exhausted Hyprland's screencopy pool and left late receivers without a decodable SPS/PPS+IDR startup unit.
Verification
70bc11b2985b1cc2e5a78c05e2254eb38487d22ego test -race -shuffle=on -count=1 ./...go vet ./...go build ./cmd/doubletake ./cmd/doubletake-ctlgofumptreview andgit diff --checkgoplsdiagnostics on changed Go filesdoubletake-ctlsubprocess test against a one-request Unix-socket fixture, including exact request fields and invalid-arity no-contact pathsstreaming→reset-restore-token→ Hyprland source picker → output selection → resumedstreaming→ targeted disconnect back toidleWayland capture QA
pipewiresrc always-copy=trueas a black-frame regression on this Intel/PipeWire portalOut of buffersevent during the gate0f38ba6Final TV stability fix
0f38ba624364f1ea1ae1ef9a4bce438f8602c4df.