The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 18:30 UTC
fix(web): Enter on an empty prompt resumes an interrupted thread (#27079)
Co-authored-by: Toni Angerer <toni@MBP-von-Toni-5.fritz.box> Co-authored-by: Julius Marminge <julius0216@outlook.com>
toni92-beep committed
Nov 12, 2026 at 23:47 UTC
a34427662be58a39191192b54f631f3e628bf617
2 files changed
+36
apps/web/src/components/ChatView.browser.test.tsx
+29
@@ -229,3 +229,32 @@ it("a rejected send leaves the timeline when a new draft was typed meanwhile", a
229
await expect.element(page.getByText("Failed prompt")).not.toBeInTheDocument();
230
expect(editor.element().textContent).toContain("Next draft");
231
});
232
+
233
+it("Enter on an empty prompt resumes an interrupted thread", async () => {
234
+ const history = threadWithHistory("interrupted", 1);
235
+ const interruptedRun = { ...history.runs[0]!, status: "interrupted" as const };
236
+ const thread = { ...history, runs: [interruptedRun] };
237
+ using _environment = installFakeEnvironment([thread], { acceptCommands: true });
238
+ __setClientSettingsForTests({
239
+ ...DEFAULT_CLIENT_SETTINGS,
240
+ onboardingCompletedAt: "2026-01-01T00:00:00.000Z",
241
+ });
242
+ const router = getRouter(
243
+ createMemoryHistory({ initialEntries: [`/${ENVIRONMENT_ID}/${thread.id}`] }),
244
+ );
245
+ await router.load();
246
+ await using _app = await render(<AppRoot router={router} />, {
247
+ // AppRoot brings its own router.
248
+ router: false,
249
+ });
250
+ await expect.element(page.getByRole("button", { name: "Resume thread" })).toBeVisible();
251
+
252
+ await userEvent.click(page.getByTestId("composer-editor"));
253
+ await userEvent.keyboard("{Enter}");
254
+
255
+ await vi.waitFor(() =>
256
+ expect(dispatchedCommands()).toContainEqual(
257
+ expect.objectContaining({ manualContinuationOfRunId: interruptedRun.id }),
258
+ ),
259
+ );
260
+});
apps/web/src/components/chat/ChatComposer.tsx
+7
@@ -2143,6 +2143,13 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
2143
});
2144
return false;
2145
}
2146
+ // An empty draft has nothing to send; Enter does what the Resume thread button does.
2147
+ if (showResumeAction && !activePendingProgress) {
2148
+ event?.preventDefault();
2149
+ if (isSendBusy || environmentUnavailable !== null) return false;
2150
+ onResume();
2151
+ return true;
2152
+ }
2153
const submission = submitComposerDraft({
2154
prompt: promptRef.current,
2155
submissionTarget,