从 v0.3.6 起,如果已在本机正常使用 OpenCode V2,保持它的默认后台服务运行,直接点星图「本机」里的 OpenCode 即可。不需要另起服务或填密码。megaworking 只连接能校验身份的、启用密码的本机回环服务,不自动启动服务、修改设置或读取远程会话。后台服务的密码不显示,也不离开本机。没有可用的 V2 后台服务时,继续尝试原有的 V1 SQLite 读取,不合并历史。
Starting with v0.3.6, if you already use OpenCode V2 locally, leave its default background service running and select OpenCode in the Local map. No second service or password entry is needed. megaworking verifies the identity of the password-protected loopback service. It does not start the service, change settings, read remote sessions, or expose its password. If no usable V2 service is found, the app still tries the existing V1 SQLite reader; it does not merge history.
如果你用的是自定义服务或希望指定实例,可以继续使用下方的手动配置;明确配置始终优先。只关闭自动识别时,在启动星图前设置 MEGAWORKING_OPENCODE_V2_DISCOVERY=0。 / For a custom service, use the manual settings below; an explicit connection always wins. Set MEGAWORKING_OPENCODE_V2_DISCOVERY=0 before starting the map to disable only automatic discovery.
-
如果已经有 V2 服务,用其实际回环地址,不必另开。否则,从平时使用的 V2 环境启动服务;第一个 PowerShell 窗口只给这个进程设置密码。 / Reuse your existing local V2 server if you have one. Otherwise start it from your usual V2 environment in the first PowerShell window:
$env:OPENCODE_PASSWORD = [System.Net.NetworkCredential]::new('', (Read-Host 'OpenCode local password' -AsSecureString)).Password opencode serve --hostname 127.0.0.1 --port 4096
-
在第二个窗口输入同一个密码,启动 megaworking,点「本机」里的 OpenCode。 / In a second window, enter the same password, start megaworking, and select OpenCode on the Local map:
$env:MEGAWORKING_OPENCODE_V2_URL = 'http://127.0.0.1:4096' $env:MEGAWORKING_OPENCODE_V2_PASSWORD = [System.Net.NetworkCredential]::new('', (Read-Host 'Same password' -AsSecureString)).Password .\megaworking.cmd ui
如果 PATH 里的 opencode 还是 V1,可以在启动 megaworking 之前指定本机 V2 可执行文件。 / If opencode on your PATH is still V1, set the local V2 executable before starting megaworking:
$env:MEGAWORKING_OPENCODE_V2_EXE = 'C:\path\to\opencode.exe'Only explicit 127.0.0.1 or [::1] URLs with a port are allowed. Do not expose the server to the network. The password is not shown in the map or included in launch arguments. It is passed only to the V2 process that connects to the same service. On macOS or Linux, run python3 handoff.py ui and copy the packet. For V1-only mode, unset MEGAWORKING_OPENCODE_V2_URL, disable discovery, and restart.
只允许明确的 127.0.0.1 或 [::1] 地址及端口,不要把服务暴露到局域网。密码不显示在星图或启动参数里,只传给连接指定服务的 V2 进程。要只用 V1,取消 MEGAWORKING_OPENCODE_V2_URL,关闭自动识别后重启。
- Listing reads only session metadata. Preview reads up to 40 recent messages from the selected session, with a 1 MiB response limit and one retry at 12 messages for an oversized page. No pagination through the transcript, tool output in the packet, or summarization calls.
- 会话列表只读元数据。交接预览最多读选中会话的 40 条近期消息;单份响应上限 1 MiB,超限才以 12 条重试一次。不翻阅全量历史、不把工具输出放入交接包、不额外调用模型。
- Windows launch requires a verified V2 CLI. It opens a fresh session on the configured service, not the default OpenCode instance. If the CLI is incompatible or the service is unreachable, copy remains available. Review the short packet before launching: the V2 CLI receives it as a local
--promptargument. - Windows 一键启动会校验 V2 CLI 版本,确认后在指定服务内开新会话。CLI 不兼容或服务不可达时,可以复制交接包。启动前请核对短包内容:V2 CLI 通过本机的
--prompt参数接收它。见 Windows 终端验收。