Skip to content

fix(agent): show host reconnects as a title-row spinner - #1461

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-hostspin-maple
Nov 5, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-hostspin-maple

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A dropped host connection filled the space above the composer: a red "Connection lost" banner while it recovered, a notice for each call it cut off, and more notices for a send or task switch tried meanwhile. The connection recovers by itself, so none of these asked for anything. A cut-off call's notice could also outlast the reconnect, still saying "Reconnect" with nothing left to do.

This replaces all of that with one muted spinner at the far right of the chat title row. Hovering it says what is happening:

  • While reconnecting: "Reconnecting to the Maple host. Sending and switching tasks are paused."
  • While reloading: "Reconnected. Refreshing task history. Sending and switching tasks are paused."

Behavior

  • Sending during a reconnect does nothing, and the text stays in the composer. It is not sent automatically.
  • Clicking another task during a reconnect does nothing.
  • Outcomes that need the user keep their banners and stop the spinner: "Reopen Maple", remote access ended, a failed reload, and the local data update.
  • Other notices are unchanged. Only errors matching host::is_host_disconnect are hidden, at render_notice, because a failed call's result can land on either side of the reconnect events.

Known tradeoffs

  • An action cut off by the drop, such as a rename, now fails with no message, and the spinner is the only sign. Requests are never replayed, so it has to be done again.
  • A remote computer's reconnect has no timeout, so the spinner can run indefinitely. The sidebar row's "Connecting…" is the only other signal.
  • "Message not sent: the Maple host disconnected." still shows as a notice when the drop hits a first message waiting on integrations, because that message really was not sent. This was left in on purpose.
  • The tooltip does not update if the phase changes while it is open.

Validation

Run on macOS 27.2 in the Agent Nix shell, with no backend, since this changes only the desktop app's UI state.

  • just ci-lint: passes.
  • cargo test --locked --workspace --no-fail-fast: 2,590 passed, 1 failed. The failure is reads_native_release_tar_format_and_preserves_bundle_modes, which is unrelated and tracked in Updater archive test fails on macOS when files carry com.apple.provenance #1460.
  • just ci-extra: passes.
  • New tests cover the spinner's position, its hover tooltip staying inside the window, unchanged layout, quiet refused actions with the composer text kept, both tooltip phases, and the real errors returned by a cut-off call.
  • Rendered the real ChatScreen offscreen in the reconnecting and hover states.

Committed with MAPLE_HOOK_SKIP=1 because the pre-commit hook stops at #1460. It only selected the Agent component, whose lanes are the checks above.

Not verified: a real host drop in the running app. The tests drive the real host events and real client errors, but not a live disconnect. The tooltip was checked on macOS only.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A dropped host connection filled the space above the composer: a red
"Connection lost" banner while it recovered, a notice for each call it
cut off, and more notices for a send or task switch tried meanwhile. The
connection recovers by itself, so none of these asked for anything, and
a cut-off call's notice could outlast the reconnect it asked for.

Show one muted spinner at the far right of the title row instead. Its
tooltip says what is happening, reconnecting or reloading task history,
and that sending and switching tasks are paused. A send keeps its text
in the composer.

Outcomes that need the user keep their banners and stop the spinner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AnthonyRonning
AnthonyRonning merged commit 97e0c31 into master Nov 5, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-hostspin-maple branch November 5, 2026 08:00
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