Skip to content

Under sbx on Windows, incode's tool server never reaches the parent, and the toolless run is reported as success #68

Closed

Description

@blockmandev

Found while checking #40 by hand on Windows 11 with the official v0.1.0.

What happens

sbx run -w . -w ~/.claude -w ~/.incode --set-env CLAUDE_CONFIG_DIR=~/.claude -- incode -t "<task>"

(network allow, so no offline account is involved)

  • The model gets no tools. It writes tool calls out as plain text (<invoke name="Read">…), and none of them run.
  • It runs until the wall limit. One run looped for 286 s; a second was killed at --wall 240.
  • incode reports success. With --output-format json it says "is_error": false, with the made-up calls as the result.

Evidence (INCODE_TRACE, same task, the same v0.1.0)

  • Without sbx, the control: bridge open on 127.0.0.1:…, then spawning claude. After 1 s the parent builds the tool list (the tool server asked), then Read ok, and the answer is right. 10 s in total.
  • Under sbx: bridge open, then spawning claude, then nothing more. The tool server never reaches the parent.
  • Claude Code itself works under the same sbx command (a plain claude -p answered in 37 s), so the break is between Claude Code, incode --tool-server and the loopback bridge.

Not yet known

Whether Claude Code fails to start incode --tool-server inside the sandbox, or the server starts and cannot connect. The tool server logs neither its start nor a failed connect (src/tool_bridge.rs ToolServer::from_env / ask), so the trace cannot tell them apart. Two probes from outside could not either.

Two fixes, whatever the cause

  1. Trace the server half: a bridge trace line when --tool-server starts, and on every from_env or connect error. The next run then names the cause.
  2. Don't report a toolless turn as success: a Claude Code turn whose tool server never asked for the tool list did not run with incode's tools. That should be an error that says so, not is_error: false.

Activity

  1. blockmandev commented on Oct 24, 2026

    @blockmandev
    MemberAuthor

    Root cause found (measured; fix in #69).

    Step Plain Under sbx
    incode -t (traced): tool server starts and lists 36 tools yes never starts
    Same, with only CLAUDE_CONFIG_DIR set (no sandbox) yes —
    claude -p alone with any stdio MCP server (a PowerShell marker script) started not started
    Node spawn(..., {stdio: 'pipe'}) ok EPERM (ignore and inherit work)
    Named pipe with default security, client opened for reading / for writing ok / ok ok / access denied

    What Windows reports for such a pipe: D:(A;;FR;;;WD)(A;;FR;;;AN)(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;<user>), the same inside and outside sbx. Under the write-restricted token, a write must also pass with one of the restricting SIDs (run SID, Everyone, logon), and none is granted write. So no program can write a default-security pipe it created:

    What Claude Code says about it: its first stream line reports it directly, "mcp_servers":[{"name":"incode","status":"failed"}], against connected in a plain run.

    #69 (incode side): that line now ends the turn at once with the reason. A turn whose tool server never asked for the tools is no longer reported as success. Live: is_error: true in 35 s, against a fake success or a 281 s wall-clock kill before.

    Still open (sbx side): Node child processes under native sbx. The fix direction is the #38 design, running as sbx-offline with that account's SID added to the restricting SIDs, so the pipe's own grant applies. It needs sbx setup-windows (admin). Until then, use SBX_BACKEND=wsl for Node-based agents.

  2. blockmandev commented on Oct 24, 2026

    @blockmandev
    MemberAuthor

    Closed by #69 (merged as 2ac5369, all 12 CI checks green on Windows, Linux and macOS).

    Fixed in incode:

    • Error, not success: a Claude Code turn whose tool server never started is no longer reported as success.
    • Fails at once: when Claude Code's first line reports incode's server as failed, the turn stops with the reason (35 s live, instead of a fake success or the 281 s wall clock).
    • Nothing left behind: the CLI is no longer left running after an error.
    • Trace: INCODE_TRACE now shows the tool server's side.

    Not fixed here, moved to #38: native sbx still can't run Node child processes with piped stdio (default-security named pipes, see the table above), so Claude Code under native sbx gets no MCP tools. The fix is the #38 design, running as sbx-offline with that account's SID trusted, and it needs sbx setup-windows (admin). Until then, SBX_BACKEND=wsl is the way to run Node-based agents under sbx.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions