Repository navigation
fix: recover retired same-target desktop connections without a new session - #50
Conversation
Requested Astra + Fable second opinions: SOURCE SIGNOFFThe human expressly authorized an admin merge of this PR if both requested models sign off. Both have now returned SOURCE SIGNOFF on exact current-main-integrated head
Both received the same substantive H1–H6 brief through the second-opinion workflow, no tools or native actions. These are independent model source assessments of supplied excerpts/results, not GitHub formal approvals, native recovery reproduction or universal desktop safety certification. Actual routing receipts confirm the two requested models. Model inventory alone was not treated as execution evidence. Exact integration/check evidence
Nonblocking findings / honest scopeBoth reviewers support explicit same-target retired-transport replacement, not automatic operation retry. Pause/halt state, held-input and declined-disclosure boundaries remain; failed or uncertain input is never replayed. Current Mac episode settlement still precedes retarget. Existing selected local repair is not being reloaded during this merge. Astra recommends future direct guarded-write-refusal and partial-handshake tests. Fable additionally notes explicit no-guard override behavior, production assertion/private halt snapshot, and Mac episode/refusal coverage. These were explicitly nonblocking, recommended as follow-up rather than a new framework or release campaign. The partial non-EOF readline timeout issue is preexisting/inferred, not established as this PR's regression. Coverage does not establish native Mac recovery, all failure races, general malformed-protocol retirement or PR44 integration. No new input was sent to a real desktop for these reviews. Only the missing formal-review requirement is being bypassed under the fresh human exception. No check failure, protection setting, tag, release asset, user Stop or historical unknown operation is overridden. Final main/head/check readback is required immediately before the single admin merge; publication/adoption is reported separately. Verified merge and exact-source delivery handoffCompleted November13 3:05:37 PM PST: PR50 is MERGED as Delivery: canonical source is |
What does this change?
Fix the dead end where
desktop(action="retarget", target=<same host>)successfully builds a new SSH connection, then discards it because the target identity matches the old, retired connection. Agents currently need a fresh tool mount to recover.The existing retarget command now rebuilds a retired same-target binding through its ordinary connect/guard/display/policy/disclosure path. Healthy same-target requests stay no-ops. A successful remote disclosure cached on the dead agent is recreated on the replacement agent; human refusals remain refused. Existing pause/halt decisions carry forward, so recovery permits observation without clearing Stop. The transport error now points to this working recovery path rather than prescribing a fresh session.
This is a small lifecycle correction, not a recovery service, background retry loop, new approval, new ledger, or new public API. Failed read/write operations are not replayed. No guard/presence/clock thresholds or input backend code changes. No installed hotpatch or live configuration changes.
A reproduced incomplete screenshot response exposed one adjacent gap: EOF can return nonempty partial JSON, which previously escaped as JSONDecodeError without retiring the stream. The existing newline-framed transport now requires the terminating newline for handshake and response. Incomplete output follows its existing connection-failure/diagnostic/retirement path, with no response bytes logged and no action retry. This diagnoses the observed truncated output correctly; it does not claim to establish why the remote agent exited.
Type of change
Testing
-I: retarget, shared transport, announcement deduplication, halt invariant, module cleanup, target model claims and SSH framing/stderr.New regression uses the actual SharedTransportHandle, RemoteBackend and ComputerTool.retarget with only the SSH wire faked. Before the fix, read and click failure both leave the dead backend selected despite success. After the fix, the new binding can read windows, the old connection closes once, no failed operation is sent to the replacement, and disclosure is rebuilt. Controls retain healthy no-op, held-input/inflight refusal, cached human refusal, pause/halt and unchanged remote policy. Two added stop-control cases bring focused count78 to80.
Observed incident: Arcade's prior tool connection failed on a read. Same-target retarget returned no-op; a fresh worker mount could read the same host. A later unpatched screenshot returned incomplete JSON before the next read hit a broken pipe; same-target recovery remained a no-op. No failure was injected into the user's desktop and no input was replayed. A real closed-pipe regression covers partial response/error diagnostics/privacy/one request only.
Initial head57133 CI passed all four checks; Python3.11 log records2116PASS/8SKIP. Independent source review found no actionableP1/P2 in that six-file delta. Added framing delta25421 awaits current-head CI/review; prior local collection error remains distinct.
Evidence checklist
Review focus
Recommend the existing explicit retarget path over an automatic retry system: it is smaller and preserves the distinction between a connection repair and an unknown click. Check successful disclosure invalidation only on retired transports, persistence of refusal/Stop, and continued use of the existing atomic binding swap. Based on main27202d8; independent of pending Windows event timestamp PR44, whose selected local repair is untouched. No authority to bypass repository protections or merge that separate PR is claimed.