Repository navigation
Clear a host-offline answer error once the thread's host reconnects - #4456
Merged
Merged
Conversation
Answering an approval, plan review or question while the thread's host was offline showed "Failed to submit response. Host is offline." The message came from the last submit attempt, so it stayed after the host came back, although the interaction could be answered again. The error is now hidden once the thread's host shows connected; a new attempt that fails shows its own error as before. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Human comments
What was wrong
Answering an approval, plan review or question while the thread's host is offline fails with
host_unavailable, and the card shows "Failed to submit response. Host is offline." That message is the React Query mutation's last error (useResolveThreadPendingInteraction), which only changes on the next submit. So after the host reconnected, the card kept saying the host was offline even though the interaction could be answered again. Since #4271 an interaction survives a host outage instead of being cancelled, so this stale message is now the normal path after answering during a drop.What changed
apps/app/src/hooks/mutations/thread-interaction-mutations.ts:useResolveThreadPendingInteraction(threadId)looks up the thread's host (thread → environment → host list, all cached queries the thread view already uses) and hides a host-offline error once that host shows connected. Any other error, or a new attempt that fails, is shown as before.apps/app/src/lib/lifecycle-errors.ts:isHostDisconnectedErrorrecognises thehost_unavailable/disconnectedAPI error.threadId: the approval and plan-review card (ThreadPendingInteractionBanner.tsx) and the question form (UserQuestionInteractionContent.tsx), which all use this one hook.No wire, CLI or server change.
How you verified
thread-interaction-mutations.test.tsx: an answer fails with the host-offline error while the thread's host is disconnected; once the host list shows it connected the error is gone. It fails without the change (expected HttpError: HTTP 502: Host is not connected … to be null).pnpm exec turbo run typecheck lint test --filter=...[origin/main].main(1efad32226): after reconnecting, the card still said "Host is offline." until the next click.pnpm start:worktreeat this head, with a real Codex approval on a disposable second host reached through a TCP proxy: "Allow once" while the host was offline showed the error; 5s after reconnecting the error was gone and the button still there; "Allow once" again ran the command and the agent repliedapproved-done. Plan reviews and questions share the code path and the unit test, but were not driven live.