Commit Graph

5 Commits

Author SHA1 Message Date
王性驊 756882293f 全 app HTTP 連線 5 秒快失敗:修重開後「好久連不上」和按鈕卡 30 秒
根因:所有 ureq client 只設了總超時,連接超時是 ureq 預設的 30 秒。
重開 App、斷網、tailnet 未就緒時,每個請求(重連帳號伺服器、模型呼叫、
web 抓取、webhook)都靜靜掛滿 30 秒才發現連不上——App 重開後好久連不上、
按停止/任何按鈕長轉圈,都是這 30 秒。

- net::agent(共用基底)+所有自建 client(remote/teams/triggers/embed/
  phone/web/channels/botbrowser/mcp_oauth)統一 timeout_connect 5 秒
  (HF 大檔下載 10 秒、本機瀏覽器 3 秒)
- 帳號伺服器重連迴圈照 1→2→4…30 秒退避:連不上時 5+1 秒就重試,
  重開 App 到連上從 30–70 秒降到 ≤6 秒
- 新鎖測試 connecting_dies_fast_everywhere

已驗證: cargo test 722 全綠。
未驗證: 真機重開後連線秒數(使用者自觀);離線場景需實機斷網。
2026-11-19 16:01:50 +08:00
王性驊 1ad81532cd feat: 所有 HTTP 用戶端信任同一份憑證;連接器連同它帶起來的程式一起關;按停止馬上結束連接器的呼叫
工程基礎計畫 E5,參考 grok-build 的 clippy.toml(HTTP 用戶端只能從一個地方建)和 ProcessScope。

- net.rs:net::config() 是所有 HTTP 用戶端的起點,憑證是公開的加上這台電腦自己信任的(tunnel::trusted_roots);net::agent(秒數) 是常用的那種(整個請求的逾時、錯誤狀態當成回答,一種逾時一個、重複用)。18 個自己建 ureq 的地方全部換成 net::config(),各自的逾時、轉址、User-Agent 不變。以前只有連帳號伺服器的那條看這台電腦信任的憑證:公司自己簽憑證的連接器、模型服務、Webhook 在別處會失敗。帳號伺服器的用戶端改用 net::agent,拿掉它自己的那份快取。
- clippy.toml:disallowed-methods 擋 ureq::Agent::config_builder(net.rs 以外)。
- 連接器:關掉、移除、重新連線、連不上時用 tools::kill_tree 連同子行程一起關(npx/uvx/sh 底下真正的伺服器以前留著)。
- mcp::call_until:本機連接器的呼叫每 0.2 秒看一次停止,按停止馬上回「已停止」;伺服器晚到的答案下一次會跳過。用網址連的還是等它回或 120 秒(ureq 的請求停不下來)。
- 測試用的假連接器多一個 slow 工具(FAKE_SLOW=1 才列出,不影響其他測試的工具數)。

已驗證:cargo test 560 全過;cargo clippy 沒有 disallowed 的違規。新測試:按停止 0.3 秒後呼叫在 2 秒內結束、之後同一個連接器照樣能用(sum=3);用 sh 帶起來的連接器關掉後,它帶起來的 sleep 也沒了;所有用戶端的憑證至少是公開那一份。
未驗證:公司自己簽憑證的真的連接器(這台沒有)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:13:59 +08:00
王性驊 eb3157852a 安全、修正: harden sandboxes, approval gates, vault, relay roles, and fix protocol/UI bugs
- macOS 沙盒與工具 (tools.rs, policy.rs, docindex.rs): block AppleScript raw events and
  concatenation outside the sandbox; stop exposing ~/.ssh or localhost sockets in Sealed
  mode; deny writes to shell profiles, LaunchAgents and .git/hooks; expand secret-file
  ignores and enforce symlink/policy checks across SSH, device and document search.
- 電腦操作與遮罩 (computer.rs, agent.rs, marks.rs, desktop.rs, cloudbox.rs, portal.rs):
  forbid clicking or typing into AnyBot's own windows; extend the sensitive-action hard
  gate to raw coordinates, Return/Delete submits and remote devices; stop batch steps if
  the front app changes; black out secrets on zoom, show, >600-node trees, adjacent OTP
  labels, box screenshots and control text lists; preserve non-text Wayland clipboards.
- 保險庫與瀏覽器 (vault.rs, vault_store.rs, browser.rs, botbrowser.rs, web.rs, box/browser):
  verify tab host and HTTPS atomically at fill time; taint filled tabs against browser_eval
  and PDF export while masking card/CVC values and screenshots; remember sites only on
  always-allow; drop --remote-allow-origins=*; gate private URLs and block metadata/Docker
  ports, OrbStack 198.18/15 and IPv6 transition ranges.
- 帳號伺服器、同步與傳送 (relay/, remote.rs, mirror_ui.rs, share.rs, drops.rs): isolate
  paired hands hosts from brain sync, tickets, pairing and backup overwrites; redact
  routine trigger secrets and clear REDACTED when endpoints change; isolate channel and
  team-member turns from owner memories, appctl and grants; scrub shared bot exports and
  reset grants/routines on import; validate drop IDs and serialize chunk writes.
- 網路與協定穩定性 (httpd.rs, tunnel.rs, vnc.rs, Caddyfile*): fix chunked integer overflow
  and CRLF header injection; enforce Origin checks, connection/job caps, 200 MB backup
  reads, unique atomic temp files and ASCII hex guards; bound deflate unzip and VNC sniff
  buffers; move VNC stdin/text off the tunnel loop.
- 介面、排程、語言與其他修正 (app.rs, i18n.rs, providers.rs, skills.rs, routines.rs,
  setup.rs, store.rs, preview.rs, attach.rs, speech.rs, teams.rs, mcp.rs, voice.rs):
  wire up the delete-routine confirmation dialog and mirror run-now; preserve unsaved
  mirror edits across brief disconnects; give Chinese skills distinct folders and approval
  gates; convert parsed tool JSON fields without corrupting code fences, URLs or paths;
  fix Hourly DST offsets and time out unattended routine approvals; lock --install-skill,
  cap docx/xlsx unzip sizes, isolate test env keys, and tighten local file permissions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-12 14:34:10 +08:00
王性驊 5dfb5d1c6c Routines follow the clock in each timezone; channels resume where they stopped; pages find checks the bot 2026-11-05 15:48:22 +08:00
王性驊 d7ee3f5db9 AnyBot: first commit of the working desktop app
Rust/egui rebuild of Grok Bot as of 2026-11-04: chat with streaming
providers (xAI, OpenAI, Claude, Gemini, OpenRouter, OpenCode Go, Ollama,
custom), tools and approvals, the bot's Docker computer, computer use on
macOS / Linux X11 / Wayland, AnyBot's browser with a full DevTools-based
toolset, the encrypted vault, pinned grid and sidebar sections, Markdown
with Mermaid diagrams, phone access through the relay, and the Linux
build and test scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa
2026-11-04 16:51:51 +08:00