Skip to content

fix: recover retired same-target desktop connections without a new session - #50

Merged
Brian Krabach (bkrabach) merged 4 commits into
mainfrom
fix/reconnect-same-desktop-target
Nov 13, 2026
Merged

Brian Krabach (bkrabach) merged 4 commits into
mainfrom
fix/reconnect-same-desktop-target

Conversation

@bkrabach

@bkrabach Brian Krabach (bkrabach) commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Bug fix
  • Documentation

Testing

  • 93 focused headless tests pass under Python -I: retarget, shared transport, announcement deduplication, halt invariant, module cleanup, target model claims and SSH framing/stderr.
  • Changed Python files pass Ruff0.16.1 format/check and git diff --check.
  • Full local suite: attempted, collection blocked by missing jsonschema/http client dependencies in the reused focused environment; original error retained, not called a pass. Normal CI installs maintained test requirements.
  • Native coexistence run: not repeated; no injection/presence classifier/backend semantics changed. No universal native recovery claim.

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

  • New native timing/input-delivery/permission claim.
  • GUARD_MEASURED flag changed.
  • Neither applies; changed-boundary proof is headless transport/binding composition.

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.

@bkrabach

Brian Krabach (bkrabach) commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

Requested Astra + Fable second opinions: SOURCE SIGNOFF

The 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 1845e2f81555b989d80800dc6ff98d89952258fd, tree 37ef6c91454e0a23edcdf480ad8751094b7d16b1:

  • Astra / openai:gpt-6-astra, review session 0000000000000000-721d6217fc334ff9_self: “Approve the minimal source fix … No blocking source defect is demonstrated by the supplied excerpts.”
  • Fable / fable:claude-fable-5-2, review session 0000000000000000-f2426864a059496d_self: “SOURCE SIGNOFF … I found no blocking defect in the supplied delta.” Conditions: exact head CI green; main still f0cb9d99ff6f1016562a58e310d183fb0cef3386.

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

  • Ordinary no-conflict merge of current main (accepted Mac episode lifecycle) into the existing PR; no authoring changes to accepted Mac behavior. PR44 Windows clock work remains separate.
  • Fresh exact-head CI 43521886637: Python 3.11, Python 3.12, Ruff and CLA all SUCCESS.
  • Both raw test logs check out merge ref 6063091c44a6714a5e692f073df2979b6b49ce3e, whose tree equals the reviewed head exactly: 37ef6c91454e0a23edcdf480ad8751094b7d16b1.
  • Python 3.11: 2,274 passed, 8 skipped, 40.78 s. Python 3.12: 2,274 passed, 8 skipped, 31.66 s.
  • Local selected retarget/shared/EOF/module-cleanup/halt tests: 83 passed, zero skipped. A prior larger local attempt failed collection for absent jsonschema; preserved as failed, not passed. No dependency/settings mutation to hide that failure.

Nonblocking findings / honest scope

Both 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 handoff

Completed November13 3:05:37 PM PST: PR50 is MERGED as 7978da1f746c3cf8eb99e6248798630f5f6fd9f6, parents current-main f0cb9d99ff6f1016562a58e310d183fb0cef3386 and reviewed 1845e2f81555b989d80800dc6ff98d89952258fd. Actual merge tree 37ef6c91454e0a23edcdf480ad8751094b7d16b1 equals the reviewed head and tested CI tree. Main/head/check conditions were verified immediately before the one human-authorized admin merge; GitHub now independently confirms this immutable merge identity. Repository protection settings were not edited. A later read again confirms PR MERGED and CI43521886637 SUCCESS; no merge or input was replayed.

Delivery: canonical source is microsoft/amplifier-bundle-computer-use@7978da1f746c3cf8eb99e6248798630f5f6fd9f6, not an unmerged local patch. Downstream source selection/adoption remains with Main through the ordinary selected-source mechanism. The pre-existing local selected repair c061 is intentionally unchanged; it includes separate PR44 work and must not be represented as byte-identical to PR50. This handoff does not hotpatch/remount the active controller, claim PR44 merged, or replay historical unknown GUI input. PR50's required signoffs, exact-head checks and authorized source merge/handoff are complete. Arcade no-terminal/#2019 release and PWA journey remain a separate incomplete objective.

@bkrabach
Brian Krabach (bkrabach) merged commit 7978da1 into main Nov 13, 2026
4 checks passed
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.

2 participants