UI-TARS Desktop cancels every step at 30 seconds? It's a hard-coded timeout — how to prove it, and what the fix involves A developer traced UI-TARS Desktop v0.2.4's recurring "Connection error" failures to a hard-coded 30-second request timeout — the literal `timeout: 3e4` — appearing in two places inside `invokeModelProvider` in the app's bundled `dist/main/main.js`. Field logs on a modded RX 580 rig running UI-TARS-1.5-7B via llama.cpp showed no completed agent step ever exceeded 28.1 seconds while failed steps were cancelled at 27.2 and 29.6 seconds, with the server log clean throughout. The developer argues a healthy `/v1/models` response and an error-free server log rule out the model, GPU and VRAM, pointing instead to the client-side timeout. This is the second article in this series. The first one https://dev.to/barrcreations3d/running-llamacpp-and-stable-diffusioncpp-on-an-rx-580-polaris-via-vulkan-on-windows-when-rocm-1hni covered getting local AI running on a Polaris card via Vulkan at all. This one is about a single defect that nearly ended the desktop-agent part of that project on its first evening — and that will eat yours too if you run UI-TARS Desktop against a local model server on modest hardware. The rig, for reference: a modded RX 580 Polaris, gfx803 with 16 GB of VRAM, a 2-core Celeron with no AVX2, 16 GB of DDR4, Windows 11. The stack: UI-TARS-1.5-7B served by llama.cpp's llama-server , driven by UI-TARS Desktop v0.2.4 — the last release of the Desktop line, which is now archived. Everything below was proven against that version specifically. The agent starts a task. The first step or two complete. Then a step runs long — and at roughly 30 seconds it is cancelled and reported as a "Connection error." The run dies or retries pointlessly. Meanwhile, the llama-server log is perfectly clean : no crash, no error, no out-of-memory, nothing. The server was still working on its answer when the app stopped listening. That combination — steps dying at a suspiciously round number, with a healthy server — is the whole story. The rest of this article is proving it and understanding what fixing it actually takes. Because the error says "Connection," people debug the connection. They restart the server. They try a different model. They check the base URL, the port, the firewall, the API-key field. They reinstall. They blame the graphics card, because on legacy hardware the card is guilty until proven innocent. None of it helps, because none of it is the problem. Two observations rule the whole server side out before you touch anything: A clean server log is evidence, not an absence of it. If the model, the card, or VRAM were failing, llama-server would say so — it is not shy about logging allocation failures and device losses. A log that shows the request arriving and generation proceeding normally, right up until the client vanishes, is the server testifying that it was fine. A bound port proves nothing — but the model list does. llama-server binds its port before the model finishes loading, so "the port answers" is not proof of health. The check that counts is the model alias answering at http://127.0.0.1:8080/v1/models . If your alias is listed there, the server is up, loaded, and serving. Whatever is killing your steps, it is downstream of a healthy server. Here is the evidence that convicted the app, from a full day of field logs on the rig above. On this class of hardware, a legitimate agent step — screenshot, vision encode, model thinking, action out — takes 20 to 28 seconds . That is normal. It is also, notice, uncomfortably close to 30. Now the fingerprint: in an entire day of logs, no completed step ever exceeded 28.1 seconds. Not one. And the steps that died were cancelled at 27.2 s and 29.6 s . Think about what that means. Real work has a distribution — some steps at 19 s, some at 24 s, occasionally one at 34 s that still finishes. A hard ceiling that no successful step ever crosses, with failures clustered just under it, is not a distribution. It is a guillotine. Something was cutting every request at the same height, and 28.1 s was simply the longest step that ever squeezed under the blade. If your steps die at random times with errors in the server log, you have a different failure — work the server side. But if they die at ~27–30 s against a clean log, you have this one. UI-TARS Desktop 0.2.4 hard-codes a 30-second timeout on model requests: the literal timeout: 3e4 — 3e4 is 30,000 milliseconds — in two places inside invokeModelProvider in the app's bundled dist/main/main.js in the 0.2.4 build they sit at lines 73336 and 73363, one for each of the app's two model-call paths . There is no settings field for it. No config file exposes it. It is a constant, compiled into the bundle, chosen by someone who presumably assumed the model would be a fast cloud API. Against a local model on a 2-core machine, 30 seconds is not a timeout — it's a coin flip that lands wrong a third of the time. You don't need my logs. Run these checks in order: http://127.0.0.1:8080/v1/models in a browser. Your model alias should be listed. Server: innocent. app.asar in the install folder. Extract it or search an extracted copy and look in dist/main/main.js for timeout: 3e4 near invokeModelProvider . Two occurrences in 0.2.4. One caution from the field: search anchored on the timeout: property — a bare 30000 also appears in port numbers and animation delays, and those are not yours to change. If all four line up, you don't have a server problem, a model problem, or a hardware problem. You have a constant. At orientation level, the fix is simple to state: raise both timeouts from 3e4 to 6e5 — ten minutes — so a slow local step is allowed to finish. And after patching, the proof was unambiguous: pointed at a deliberately slow CPU-encode server whose steps used to die at 29.6 s, the patched app completed model invokes of 300, 298, and 372 seconds . The wall was the app. It always was. What makes it a job rather than an edit is everything around that one-line change: UI-TARS.exe , copied somewhere safe before you touch anything. Restoring those three returns the app to stock, untouched. This is also why I'd argue for a scripted patch over hand-editing: a script can anchor on the timeout: property and only that , count its replacements, recompute both hashes from the archives, swap the new one in, and verify its own work before declaring success. A hex editor does none of that, and the failure mode of getting it wrong is an app that won't start and no note about why. One more honesty note: this patch is version-specific . It was proven on Desktop 0.2.4; another build may word or place the value differently, and any tooling worth using should report "not found" rather than guess. Raising the wall buys you room; it doesn't make steps quick. Two settings decide how long a step takes on this stack, and readers hitting the timeout usually need both: Offload the vision projector. Launch llama-server with --mmproj-offload so the screenshot encode runs on the GPU. Without it, the encode runs on the CPU — on the 2-core field rig that took ~85 seconds per screenshot , and every step died waiting that was true even before the timeout entered the picture . With the projector on the GPU, steps land around ~20 seconds . Cap the vision tokens. --image-max-tokens 768 is the field-proven setting. Uncapped, the vision encode crashed the graphics card outright ggml vulkan: device lost . At 512 the agent is stable but can't aim — clicks land wrong. At 1024 it aims best but steps run 25–28 s, which is precisely why that setting was unusable until the timeout was patched. Hold the server context at -c 8192 while you're at it: the agent's memory is screenshots, and every remembered screen costs roughly a thousand tokens. The known-good launch line, for reference: llama-server.exe -m