mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5070] [GUI] 详情里的 fetch failed 被显示成 “Strata could not set this chat to Bypass mode”:整轮不执行,事后无任何服务端日志 #2358
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2358
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xvcezrqpbxtpzblrt on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5070
English TL;DR: A single turn was refused with the red card “Strata could not set this chat to Bypass mode, so nothing ran. Try again.” The real reason is only visible in the collapsed Details:
fetch failed— the local HTTP request the host makes to the agent harness died at the transport layer.apps/host/server/agent/gateway-client.mjs:46-63issues one plainfetchPOST with no timeout, no retry, no cause reporting, andagent-bridge.mjs:330-338converts any exception from that call into the “mode” sentence and cancels the turn. Bypass itself was fine (the same mode ran normally minutes later), the harness process was alive the whole time, and nothing is written to disk that can identify the transport failure:runtime/app-1.host.logis 0 bytes and the harness has no log file (only a 50-byte stdout line).现象(本机复现到的这一次)
fetch failed。C:\Users\123\Documents\Strata\Workspace)在 15:12:53 新建会话后,同样的 Bypass 模式切换成功并连续多轮正常跑完。所以不是权限预设不可用,也不是绕过权限的设置有问题——卡片把用户引向的方向是错的。环境(本机实测)
Strata desktop 0.2.10;hosthttp://127.0.0.1:47831;logs\desktop-20261103-010710.logwindows 10.0.26300;NVIDIA GeForce RTX 3080 Ti Laptop GPU / cuda / 16 cores / 64 GB0.1.55;agent 组件deepseek-harness 0.2.1-alpha.3(node v24.12.0,harness\BUNDLE.json)swift-iq3_s(IQ3_S 量化),providerstrata-local~s2048;聊天模式 Bypass(sandbox: danger-full-access+approval: never)会话存档解码(出故障那条对话自己的记录,只读解码)
存档:
~\.strata\data\agent\home\sessions\--C-Users-123-Documents-Strata-Workspace--\session-8e647126-…\session.v4.jsonl.zstd。append-only 多帧 zstd,逐帧解压:444 帧全解,878 条事件。turn/startturn 8;15:09:16request/header:modelswift-iq3_s,providerstrata-local~s2048,maxTokens 32768turn/endturn 8,reason: {kind:"aborted", reason:{kind:"user"}}(用户按了停止)fetch failed(即两张截图那张红卡)session-05c4f55a-…),15:14 起同模式正常;该会话投影缓存最后写入时间与运行记录一致turn/end {"turn":2,"reason":{"kind":"error","error":{"message":"Request timed out. Node.js fetch timed out waiting for response headers; configure a matching undici fetch and fetc…"}}}其间
llm/retry8 条:10:45:48、10:50:51、10:55:55、11:15:55、11:21:04、11:26:10、11:31:18、11:36:27(每条间隔约 5 分钟,retry:1..5)。dsh-llm-retry,policyKey含[normal, 5, [EMPTY_RESPONSE, RATE…]]),模式 RPC 那条路径一次都不重试,也没有 timeout。同一种传输,一条有护栏一条没有。代码路径(位置均取自已安装的 0.2.10 副本,直接核对)
host/server/agent/harness-runtime.mjs:79:harness 以--port 0启动(端口由系统分配);:18/:100从子进程 stdout 解析 URL;agent-bridge.mjs:230把baseUrl一次性缓存,此后不再更新。harness/node_modules/@deepseek-ai/dsh-host-webserver/src/index.ts:460-538:网关监听在一个可重启的服务 effect 内;销毁时执行server.close()+server.closeAllConnections()+ 销毁全部 upgrade socket;重新获取时再次listen(0)→ 端口会变。App 侧对"连接被整体切断"与"端口已换"这两种形状都没有识别:gateway-client.mjs:115-129只给 WebSocket 做重连,HTTP RPC 没有重连也没有重新发现端口的路径。host/server/agent/gateway-client.mjs:46-63rpc()::49一次全局fetch(…/api/<method>),:50method:'POST',:53只传signal;无 timeout、无重试、无 cause 上报。host/server/agent/agent-bridge.mjs:324-338:上面这串里任何异常 → 同一句Strata could not set this chat to ${MODE_PRESETS[mode].name} mode, so nothing ran. Try again.(:338),原始异常只进卡片折叠的详情,整轮取消。host/server/agent/events.mjs对ECONNREFUSED|fetch failed|connect已有 “The model is not reachable.” 的友好映射,模式路径不经过它。现场核验(本机实测)
harness.pid={"pid":3884,"at":"2026-11-03T02:16:46.588Z"};Get-Process -Id 3884→ node,启动 10:16:11,路径…\Programs\Strata\node\node.exe;故障时刻它正在服务其他对话。"后台进程死了"不是这次的原因。harness.log50 字节、最后写入 02:04:17,内容是dsh web: http://127.0.0.1:56567/?token=…;harness.pid写于 10:16:46。当前 harness(pid 3884)10:16 启动,没有重写这份 log → 排查时按日志里的端口去找必然落空。(端口行与进程时间戳相差 8 小时是事实;"当前端口是否存在"未由本机网络工具证实,见"边界"。)runtime\app-1.host.log= 0 字节(自 10-30 起);runtime\app-1.server.log是引擎日志、无时间戳;对两者Select-String 'mode-unavailable','fetch failed'无命中。这条故障除了一张一次性卡片,没有任何可回溯记录。storages/session_projcache/session-8e647126-….json最后写入 15:12:18(turn 8 收尾),15:13 前后零写入 → 那次 RPC 没有进到服务端处理。已排除(都有测量)
keepAliveTimeout=5000vs undici 池 4s):纯本机 127.0.0.1 对照,调用方式与 host 完全相同(全局 fetch POST、无 timeout、无重试),间隔随机 3–9 秒,150 次 →SUMMARY requests=150 ok=150 fail=0 gap=3000-9000ms serverKeepAlive=5000ms。解释力为零。*PROXY;系统代理ProxyEnable=0(ProxyOverride含localhost;127.*);netsh winhttp show proxy= Direct access;无 clash/v2ray/mihomo/sing-box 进程。复现与边界
warp-cli status=Connected, Network: unstable,且为"接管全部网段"的拆分路由模式(ifIndex 30 上挂有数百条0.0.0.0/5等路由,DNS 在 127.0.2.2:53 / 127.0.2.3:53)。做过一次断开 WARP 的 A/B,未拿到数据,不作结论。home/profiles/web/cordis.ymlmtime 10:16:13)、无 harness 进程重启、无插件/存储写入。唯一能指认它的两个数据源——harness 的 logger 输出与 host 日志——都不落盘,这正是查不下去的直接原因。Get-NetTCPConnection -State Listen/netstat -an从取证进程取到的监听表不完整(整机 LISTENING 只返回 6 条,而 host 端口 47831 大量出现在 ESTABLISHED/TIME_WAIT,却没有 LISTENING 行)。因此不能用它证明某个端口"没有监听";正文中所有端口相关的结论都只依赖文件时间戳,不依赖这些查询。期望 / 实际
fetch failed。对不懂英文的用户,这等于把排查方向整个带偏(本次实际发生:用户反复核对绕过权限的设置,而设置与本次失败无关)。建议
applyMode区分失败类别:传输类(fetch failed/TimeoutError/ socket 断)→ 单独文案(助手后台未响应,本轮未执行);权限预设类 → 现有文案。events.mjs已有的映射可复用。mode-unavailable的 typed code + 原始 cause(code/syscall/errno/端口)写入 host 日志(当前 0 字节,事后不可查)。dsh-llm-retry这套护栏,把它的最小组合用到 RPC 上即可,不必新造机制。harness.pid/ stdout)并重连;App 不应把baseUrl永久缓存(agent-bridge.mjs:230)。harness.log里的dsh web:端口行随当前 harness 进程重写(现在留的是凌晨那次的端口行,误导排查)。截图
fetch failed。user-images.githubusercontent.com链接)。本报告未包含
fetch failed的显示文案;断开 WARP 的 A/B(未取到数据)。版本核对(2026-11-03 补充)
本条初稿引用过 0.2.9 检出的行号(克隆于 2026-11-02 14:46,落后
origin/main5,629 个提交)。现已把检出对齐 tag v0.2.10 = ffa80d73(2026-11-03 06:37:27,与安装产物 mtime 06:37:26 一致) 逐条复核:apps/host/server/agent/gateway-client.mjs:46(async rpc(method, args = {}, { signal } = {}))、:49(const res = await fetch(\${this.#base}/api/${method}`, {)、:50(method: 'POST'`)—— 行号一致,无漂移apps/host/server/agent/agent-bridge.mjs:324(async function applyMode(runtime, sessionId, mode))、:332(line: \/permission ${want}`)、:338(那条Strata could not set this chat to … mode, so nothing ran. Try again.`)—— 行号一致,无漂移gateway-client.mjs:39只有启动握手带redirect: 'manual',:110只有 WebSocket 有重连;rpc()到 v0.2.10 仍然没有 timeout、没有重试、不把 cause 报出去本条的数值与日志证据本来就取自已安装的 0.2.10 产物,结论不变。