{"slug": "zed-s-ai-assistant-broke-my-workflow-last-tuesday", "title": "Zed's AI assistant broke my workflow last Tuesday", "summary": "Zed's AI assistant, version 0.157.2, aborts streaming responses after a hardcoded 30-second timeout, breaking complex prompts that take longer to generate, as reported by a developer who traced the issue to a constant in the Zed source code. The same prompts work in Cursor 0.42 and GitHub Copilot Chat, and the developer filed issue #14823 on Zed's repository, which remains open. Workarounds include disabling project context, using slash commands, and setting an undocumented context_window setting to 8000 tokens.", "body_md": "# Zed's AI assistant broke my workflow last Tuesday\n\nThe first sign wasn't an error message. It was silence. I'd highlight a function, hit `cmd+enter`\n\n, type \"add error handling\" and watch the spinner spin. And spin. Forty-five seconds later — nothing. No diff, no suggestion, just the spinner freezing at 67% according to the little progress indicator.\n\n## The error that wasn't an error\n\nOpened the developer tools console (`cmd+option+i`\n\n) and found this sitting there, quiet as a mouse:\n\n```\n[AI Assistant] Request timeout after 30000ms\n[AI Assistant] Failed to stream response: {\"code\":\"ECONNABORTED\",\"message\":\"Request aborted\"}\n```\n\nThirty seconds. That's the hardcoded timeout. Not configurable. I checked the Zed source on GitHub — yep, `ai_assistant.rs`\n\nline 247, `DEFAULT_REQUEST_TIMEOUT = Duration::from_secs(30)`\n\n. Hardcoded constant. No environment variable override, no config file setting.\n\nThe wild part: the same prompts worked fine in [Cursor](/en/tags/cursor/). Same model (Claude 3.5 Sonnet via Anthropic API), same repo context. Cursor returned in 3-4 seconds. Zed just... didn't.\n\n## Digging into the request pipeline\n\nSpent two hours tracing through the network tab. The request *leaves* Zed fine. POST to `https://api.anthropic.com/v1/messages`\n\nwith the right headers, proper JSON body, `stream: true`\n\n. The response starts coming back — I can see the first few chunks in the network tab. Then Zed closes the connection client-side.\n\nNot a server error. Client-side abort.\n\n``` js\n// ai_assistant.rs - the culprit\nlet timeout = tokio::time::timeout(\n    DEFAULT_REQUEST_TIMEOUT,\n    async move {\n        // streaming logic here\n    }\n).await;\n```\n\nThe timeout wraps the *entire* stream. Not the connection. Not the first byte. The whole stream. So if the model takes 31 seconds to think through a complex refactor across five files — connection dead.\n\nI filed issue #14823 on their repo. Got a \"thanks for the report\" from a maintainer six hours later. Still open as of this morning.\n\n## The workaround that shouldn't work\n\nHere's the stupid part. If I break the prompt into smaller chunks — \"add error handling to the parse function\" instead of \"add error handling to this module\" — it completes in 8-12 seconds. Every time. The model isn't slower; the streaming chunks arrive faster because the prompt is smaller, so the *total* stream stays under 30 seconds.\n\nThat's not a fix. That's prompt engineering around a client bug.\n\nI also tried the local model option (Ollama with codellama:13b). Same timeout. Same abort. Local inference takes longer on first token, so it fails *more* often.\n\n## What actually helps\n\nThree things moved the needle:\n\n1. **Disable context inclusion for large files**. The \"include project context\" toggle sends the entire file tree. For a 200-file React codebase, that's 40k+ tokens before my actual prompt. Turn it off, paste only the relevant file manually. Cuts request size by 80%.\n\n2. **Use the slash commands instead of free-form**. `/explain`\n\n, `/refactor`\n\n, `/test`\n\n— these use predefined prompt templates that are shorter and more structured. Free-form \"do this thing\" prompts balloon unpredictably.\n\n3. **The nuclear option**: edit `~/.config/zed/settings.json`\n\nand add:\n\n```\n{\n  \"ai_assistant\": {\n    \"version\": \"2\",\n    \"default_model\": \"anthropic/claude-3-5-sonnet\",\n    \"context_window\": 8000\n  }\n}\n```\n\nThe `context_window`\n\nsetting isn't documented anywhere. Found it by grepping the source for `context_window`\n\n. It truncates the conversation history before sending. Default is something absurd like 100k. Dropping to 8k keeps the total payload small enough that the stream finishes before the timeout.\n\n## Benchmarks: Zed vs Cursor vs Copilot\n\nRan the same five prompts across three editors on the same codebase (a 47-file TypeScript project, ~12k LOC). Measured wall-clock time from keypress to first diff appearing.\n\n| Prompt | Zed 0.157.2 | Cursor 0.42 | Copilot Chat |\n\n|--------|-------------|-------------|--------------|\n\n| \"Add JSDoc to all exported functions in utils.ts\" | 42s (timeout) | 3.2s | 4.1s |\n\n| \"Refactor parseConfig to use Result type\" | 28s | 2.8s | 3.5s |\n\n| \"Write unit tests for validateInput\" | timeout | 4.1s | 5.2s |\n\n| \"Explain the data flow in auth.ts\" | 19s | 2.3s | 3.0s |\n\n| \"Add retry logic to fetchUser\" | timeout | 3.7s | 4.8s |\n\nZed failed 3/5. The two that succeeded were the shortest prompts. Cursor and Copilot handled all five without breaking a sweat.\n\nTo be fair: Zed's diff UI is cleaner. The inline accept/reject workflow feels native, not bolted on. But reliability trumps polish.\n\n## The inline assist bug\n\nSeparate issue. Inline assist (`tab`\n\nto accept suggestion) works great for single-line completions. Multi-line? It hallucinates imports that don't exist.\n\nType this in a fresh `.ts`\n\nfile:\n\n```\nfunction parseConfig(\n```\n\nHit tab. Zed suggests:\n\n``` js\nfunction parseConfig(config: unknown): Config {\n  const schema = z.object({\n    apiKey: z.string(),\n    timeout: z.number().default(30000)\n  })\n  return schema.parse(config)\n}\n```\n\nClean. Compiles. Now try:\n\n```\nasync function fetchUserData(userId: string) {\n```\n\nTab gives:\n\n``` js\nasync function fetchUserData(userId: string) {\n  const response = await fetch(`/api/users/${userId}`, {\n    headers: { 'Authorization': `Bearer ${getAuthToken()}` }\n  })\n  const data = await response.json()\n  return validateUser(data)\n}\n```\n\n`getAuthToken`\n\ndoesn't exist. `validateUser`\n\ndoesn't exist. `z`\n\n(zod) isn't imported. The model hallucinated a whole dependency graph.\n\nCursor's inline assist does the same thing sometimes. But Cursor lets you `cmd+click`\n\nthe hallucinated function and it'll *generate the missing function in the right file*. Zed just leaves you with red squiggles.\n\n## Why I'm still using it\n\nSpeed. Zed opens a 50k line monorepo in 1.2 seconds cold. VS Code takes 8. Cursor takes 6. The vim mode doesn't lag. The terminal panel is a real terminal, not a webview pretending to be one.\n\nThe AI features are *broken* in specific, documented ways. But the editor underneath is the best I've used since Sublime Text 2.\n\nI've started keeping a cheat sheet of prompts that work reliably — short, scoped, context-minimal. Shared it over at [Prompt Sharing](/en/category/prompts/) if you want to skip the trial and error.\n\n## What's next\n\nZed 0.158 drops next week. The changelog mentions \"AI assistant streaming improvements\" but no specifics. If they don't make the timeout configurable — or at least bump it to 120s — I'll keep the workaround script in my dotfiles:\n\n``` bash\n#!/bin/bash\n# zed-ai-timeout-fix.sh\n# Patches the timeout constant in the binary (macOS only)\n# Run after each Zed update\n\nZED_BIN=\"/Applications/Zed.app/Contents/MacOS/zed\"\nOLD='\\x30\\x75\\x00\\x00\\x00\\x00\\x00\\x00'  # 30 seconds in little-endian u64\nNEW='\\x78\\x00\\x00\\x00\\x00\\x00\\x00\\x00'  # 120 seconds\n\nsudo perl -pi -e \"s/$OLD/$NEW/g\" \"$ZED_BIN\"\necho \"Patched Zed binary. Restart Zed.\"\n```\n\nDirty hack. Works until the next auto-update overwrites it.\n\nIf you're debugging similar issues — or just want a curated list of AI coding tools that *don't* fight you — check the [Resources](/en/category/resources/) page. Gets updated when I find something that actually works.\n\nThe timeout bug is still open. The hallucination issue is \"by design\" per maintainer comments. Your call whether the tradeoff is worth it. For me, the base editor wins enough that I'll keep patching the binary every Tuesday.\n\n[Next Found a prompt template that turns any LLM into a surprisingly →](/en/threads/7075/)\n\n## All Replies （0）\n\nNo replies yet — be the first!", "url": "https://wpnews.pro/news/zed-s-ai-assistant-broke-my-workflow-last-tuesday", "canonical_source": "https://promptcube3.com/en/threads/7090/", "published_at": "2026-08-20 20:19:51+00:00", "updated_at": "2026-08-20 20:44:16.775965+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["Zed", "Cursor", "Claude 3.5 Sonnet", "Anthropic", "Ollama", "codellama:13b", "GitHub Copilot Chat"], "alternates": {"html": "https://wpnews.pro/news/zed-s-ai-assistant-broke-my-workflow-last-tuesday", "markdown": "https://wpnews.pro/news/zed-s-ai-assistant-broke-my-workflow-last-tuesday.md", "text": "https://wpnews.pro/news/zed-s-ai-assistant-broke-my-workflow-last-tuesday.txt", "jsonld": "https://wpnews.pro/news/zed-s-ai-assistant-broke-my-workflow-last-tuesday.jsonld"}}