Skip to content

fix: integrate Windows sandbox, ripgrep search, DSH web tools, and SSE keepalive - #161

Open
phantom5099 wants to merge 1 commit into
mainfrom
fix/sandbox-ripgrep-websearch-sse
Open

phantom5099 wants to merge 1 commit into
mainfrom
fix/sandbox-ripgrep-websearch-sse

Conversation

@phantom5099

Copy link
Copy Markdown
Owner

Summary

Fixes three critical tool reliability failures plus error visibility and SSE connection stability:

  1. Windows OS-level process sandbox (@codingcode/process-sandbox):
    • Integrate @codingcode/process-sandbox (see feat: implement cross-platform process sandbox process-sandbox#1) supporting Linux bwrap, macOS sandbox-exec, and Windows Restricted Token + NTFS Capability SID ACL (koffi).
    • Update packages/codingcode/sandbox and packages/codingcode/bash to accept partial OS enforcement (Windows ACL) while still failing closed on disabled, propagate restricted env, and clean up private sandbox temp directories.
  2. Ripgrep-backed search_files and search_code (@vscode/ripgrep):
    • Replace globby (which hung indefinitely on nested pnpm workspace node_modules symlinks) and stateful RegExp('gi').test() with streaming @vscode/ripgrep (rg --files and rg --json), including --no-config, early stop at max_results, 15s timeout, and AbortSignal cancellation.
  3. DSH-aligned @codingcode/web architecture:
    • Remove brittle cn.bing.com / www.baidu.com HTML scraping that suffered from anti-bot decoy SERP poisoning.
    • Split into WebService (concurrency semaphore + signal/timeout composition), DeepSeek Tools API provider (POST /v1/tools/search & /fetch), and direct HTTP fetch provider, configured via config.yaml (web section).
  4. Error semantics, propagation & desktop UI visibility:
    • Stop mapping SANDBOX_* failures to denied (tools.ts); keep them as structured error results.
    • Stop feeding empty string "" to the model on denied (agent.ts); record [Denied] <reason>.
    • Distinguish 已拒绝 vs 执行失败 in ToolSummary.tsx and always show the reason/output when expanded.
  5. SSE keepalive & production bundling:
    • Disable Node HTTP server idle/request timeout (cli.ts) and merge 15s SSE comment keepalive frames (: keep-alive\n\n) in handler.ts.
    • Externalize and stage native runtime packages (koffi, @vscode/ripgrep, @codingcode/process-sandbox) in bundle.mjs and electron-builder.yml, and allow their build scripts in pnpm-workspace.yaml.

Dependency Note

Verification

  • pnpm install (from GitHub ref + prepare build), pnpm run typecheck (tsc -b), and pnpm --filter @codingcode/app run bundle all pass.
  • Windows confinement verified (read-only echo succeeds & blocks workspace write; workspace-write allows workspace write & blocks outside write).
  • Ripgrep benchmark on this monorepo: search_code 371ms, search_files 45ms.
  • Regression suites pass: tools + approval (145/145), agent (30/30), server + sdk (86/86), desktop (217/217).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant