Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Chat: guide continuation after Cursor stream drops

skygunnerc5a0525045ea
diff --git a/src/components/FailedTurnFix.tsx b/src/components/FailedTurnFix.tsx
index f59958ecf0..aa8d0745a6 100644
--- a/src/components/FailedTurnFix.tsx
+++ b/src/components/FailedTurnFix.tsx
@@ -23,6 +23,9 @@ export function useFailedTurnFix(tool: NonNullable<Message["tool"]>, botId: stri
const dispatch = useStoreDispatch();
const bot = useStoreSelector((state) => (botId ? state.bots.find((candidate) => candidate.id === botId) : undefined));
const phone = useMediaQuery(PHONE_LAYOUT), admin = useOwnerOrAdmin() !== false, advanced = useAdvancedMode();
+ if (/^error: (?:(?:Error|Internal error|RetriableError): )*Stream ended without turnEnded\b/i.test(tool.name)) {
+ return { action: null, control: line(t("chat.error.streamDroppedContinue")) };
+ }
// A My Cloud bot open in place: its spending and its model are My Cloud's, set on its own page.
const fix = botId && isPlaceId(botId) ? null : settingFix(tool);
if (fix === "spend-limit") {
diff --git a/src/components/FailedTurnRow.setting-fix.test.ts b/src/components/FailedTurnRow.setting-fix.test.ts
index e5bc479aec..0517e3804b 100644
--- a/src/components/FailedTurnRow.setting-fix.test.ts
+++ b/src/components/FailedTurnRow.setting-fix.test.ts
@@ -71,6 +71,17 @@ describe("a failed turn one setting fixes", () => {
expect(member).toContain("Ask the owner to raise the spend limit.");
});
+ it.each([
+ "Stream ended without turnEnded — connection likely dropped mid-stream",
+ "Error: RetriableError: Stream ended without turnEnded — connection likely dropped mid-stream",
+ "Internal error: Stream ended without turnEnded — connection likely dropped mid-stream (session/prompt)",
+ ])("guides the person to continue in the same chat after %s", (cause) => {
+ const html = show(failedTurnTool(cause));
+ expect(html).toContain("Check what already ran, then send a follow-up in this chat with only the work that remains.");
+ expect(html).toContain(cause);
+ expect(buttons(html)).toEqual([]);
+ });
+
it("adds nothing to a failure no setting fixes, or for a bot it does not know", () => {
expect(show(failedTurnTool("the process running this turn's AI ended — the turn was stopped"))).not.toContain("data-failed-turn-fix");
fixture.bots = [];
diff --git a/src/locales/en.json b/src/locales/en.json
index e59d5631a7..173ef5eba2 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -2740,6 +2740,7 @@
"chat.notice.signInHint": "Open AI settings to sign in again",
"chat.error.pastUsageLimit": "Past usage-limit notice (reset time passed; check current usage)",
"chat.error.details": "Details",
+ "chat.error.streamDroppedContinue": "Check what already ran, then send a follow-up in this chat with only the work that remains.",
"chat.error.partial": "Partly done. The reply came back, but a step didn't work, so check that step before relying on it.",
"chat.error.partialPreview": "Partly done: a step didn't work",
"chat.error.requestTooLarge": "This message is too large for {model}. Start a new chat or pick a model that accepts more.",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 2e355b71dd..7c22c5f0c6 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -2704,6 +2704,7 @@
"chat.notice.signInHint": "打开 AI 设置以重新登录",
"chat.error.pastUsageLimit": "之前的用量限制通知(重置时间已过;请检查当前用量)",
"chat.error.details": "详情",
+ "chat.error.streamDroppedContinue": "检查已完成工作,然后在本对话中仅发送剩余事项。",
"chat.error.partial": "部分完成。回复已经返回,但有一步没有成功,所以在依赖它之前请先检查那一步。",
"chat.error.partialPreview": "部分完成:有一步没有成功",
"chat.error.requestTooLarge": "这条消息对 {model} 来说太大了。请开始新的对话,或选择能接受更多内容的模型。",