CommandCodeAI / CommandCodeAI/command-code

WebSocket connections fail behind Fence sandbox (ignore HTTPS_PROXY)

未關閉
#625 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
沒有語言資料
星號
4k
分支
350
PR 合併指標
30 天內沒有已合併 PR

描述

Summary

When running Command Code inside popular sandbox tool Fence (https://github.com/fencesandbox/fence) (Linux sandbox using bwrap --unshare-net), all WebSocket connections time out. Fence routes network traffic through an HTTP proxy (HTTPS_PROXY=http://127.0.0.1:3128) since direct TCP is blocked by the network namespace.

curl, fetch, and HTTP requests work correctly. However, new WebSocket(url) (used in buildSandboxStreamUrl / defaultCreateSandboxStreamSocket) ignores proxy env vars and attempts a direct TCP connection, which is blocked by the sandbox.

The codebase already has detectProxyFromEnv(). Maybe use ws package with https-proxy-agent for WebSocket connections when a proxy is detected, instead of the built-in WebSocket

Expected Behavior

CommandCode working inside Fence sandboxing

Actual Behavior

Connection issues with Fence. Can't use CommandCode with it.

Steps to reproduce the issue
  1. Install and configure Fence ( https://github.com/fencesandbox/fence )
  2. Run CommandCode with "fence cmd"
Command Code Version

1.10.0

Operating System

Linux

Terminal/IDE

JetBrains-JediTerm

Shell

bwrap

Session file (optional)

No response

Fix prompt (optional)

No response

Additional context

No response

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先追蹤 buildSandboxStreamUrl 和 defaultCreateSandboxStreamSocket,接著檢查 detectProxyFromEnv 如何用於現有的 HTTP 請求。重現 Fence sandbox 失敗的問題,並驗證 WebSocket 連線能透過設定的 HTTPS_PROXY 成功連線,同時不破壞直接連線。

由索引模型根據 Issue 內容生成。

評估

領域
cli, networking
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。