提交记录修改lib/code.sh+7 −3看文件
修改tests/22-code.sh+1 −1看文件
| @@ -151,8 +151,12 @@ _agent_vm_code_session() { | ||
| 151 | 151 | [[ -t 0 && -t 1 ]] && want_tty=1 |
| 152 | 152 | # Bound to the VM's loopback, which Lima forwards to this machine's only. |
| 153 | 153 | # The cookie suffix keeps sessions apart at 127.0.0.1. --disable-proxy: no |
| 154 | 删除: # route from the browser to the VM's other ports; VSCODE_PROXY_URI sends a | |
| 155 | 删除: # link to localhost:<port> to that port here instead. The --vscode-option | |
| 154 | 新增: # route from the browser to the VM's other ports; empty VSCODE_PROXY_URI | |
| 155 | 新增: # leaves a link to localhost:<port> at that port here instead of rewriting | |
| 156 | 新增: # it through the editor's /proxy/. An absolute template such as | |
| 157 | 新增: # http://localhost:{{port}}/ breaks the workbench: code-server runs | |
| 158 | 新增: # new URL() on it before substituting {{port}}, which throws Invalid URL | |
| 159 | 新增: # (coder/code-server#6504). The --vscode-option | |
| 156 | 160 | # ones: no experiments, and the built-in Copilot Chat never loads. Claude |
| 157 | 161 | # Code's login pages open without the link prompt, those paths only. |
| 158 | 162 | # |
| @@ -162,7 +166,7 @@ _agent_vm_code_session() { | ||
| 162 | 166 | # other's editor; keeping them apart needs network isolation, which |
| 163 | 167 | # agent-vm does not have yet. |
| 164 | 168 | _agent_vm_lima_run "$vm_name" "$host_dir" "$want_tty" \ |
| 165 | 删除: 'VSCODE_PROXY_URI=http://localhost:{{port}}/' code-server \ | |
| 169 | 新增: 'VSCODE_PROXY_URI=' code-server \ | |
| 166 | 170 | --config "$cfg" \ |
| 167 | 171 | --bind-addr "127.0.0.1:$port" \ |
| 168 | 172 | --cookie-suffix "$vm_name" \ |
| @@ -49,7 +49,7 @@ if _agent_vm_host_port_open "$first"; then | ||
| 49 | 49 | printf ' skip code launch tests (port %s is taken on this machine)\n' "$first" |
| 50 | 50 | else |
| 51 | 51 | out="$(rec code)" |
| 52 | 删除: rec_has "agent-vm VSCODE_PROXY_URI=http://localhost:{{port}}/ code-server --config /home/u/.config/code-server/agent-vm-lima-x.yaml --bind-addr 127.0.0.1:$first --cookie-suffix $PV" \ | |
| 52 | 新增: rec_has "agent-vm VSCODE_PROXY_URI= code-server --config /home/u/.config/code-server/agent-vm-lima-x.yaml --bind-addr 127.0.0.1:$first --cookie-suffix $PV" \ | |
| 53 | 53 | && pass "code-server on the VM's loopback, the VM's own config and cookie" \ |
| 54 | 54 | || fail "code: $(grep 'code-server --config' "$REC")" |
| 55 | 55 | rec_has "--disable-getting-started-override --link-protection-trusted-domains https://claude.com/cai/oauth --link-protection-trusted-domains https://platform.claude.com/oauth --vscode-option" \ |

