Skip to content

ACP session/load fails with "Client must Subscribe with a working_dir" despite valid cwd in the request #764

Description

@sergiomeneses

Environment

  • jcode version: jcode v0.67.1 (88a19f3)
  • OS: Windows 10.0.19045, Zed running natively on Windows, project + jcode binary both in WSL2 (Ubuntu)
  • Zed: v1.13.2+stable.335.5cdb7ab9d9546db683132cfa78e68acec3064cac (Zed)
  • Connected via Zed's native Remote WSL (projects: open in wsl)

Config (Zed settings.json)

json "agent_servers": { "Jcode": { "type": "custom", "command": "jcode", "args": ["acp"], "env": {} } } ​

Steps to reproduce

  1. Start a Jcode thread in Zed's Agent Panel, use it normally (works fine — session/new succeeds).
  2. Reopen/resume that same thread (either by revisiting it in the panel history, or after a Zed restart).
  3. Zed sends session/load with a valid cwd:
    json { "mcpServers": [], "cwd": "/home/shiftrtech/software/internal/iris", "sessionId": "session_chicken_1785825398905_1e8a7502f275f451" } ​
  4. jcode responds with:
    json { "code": -32603, "message": "Failed to attach Jcode session 'session_chicken_1785825398905_1e8a7502f275f451': Client must Subscribe with a working_dir before sending stateful requests" } ​

Expected behavior

session/load should complete the same internal daemon "Subscribe" step that session/new apparently does (per docs/SERVER_ARCHITECTURE.md: "a client sends its current working directory to the server when it subscribes, and the server uses that as the session working directory").

Notes

The cwd field in the request is correct and native to the WSL2 environment where jcode runs — this isn't a Zed-side path translation issue, the value reaching jcode is valid. The failure appears isolated to handle_session_load in src/cli/acp.rs not performing the subscribe that handle_session_new does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: clearHands-off: unambiguous bug, obvious fix, no decisions. Don't even look - an agent can fully solve.bugSomething isn't workingpriority: highP1 - important bug or impactful feature, fix soontriage: reproducibleClear repro + clear fix path

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions