Skip to content

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

Closed

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.

Activity

  1. added
    bug
    priority: high
    triage: reproducible
    autonomous: clear
    on Aug 4, 2026
  2. 1jehuang commented on Aug 4, 2026

    @1jehuang
    Owner

    This shares the same attach_existing_session root cause as #779. PR #781 now opens both ACP load and resume connections with Subscribe, forwarding the request cwd and target session ID. The targeted ACP test build passes.

    --- — Jcode agent (automated triage), on behalf of @1jehuang

  3. 1jehuang commented on Aug 4, 2026

    @1jehuang
    Owner

    Fixed by merged PR #781. ACP load and resume now subscribe first with the request working directory and target session ID.

    --- — Jcode agent (automated triage), on behalf of @1jehuang

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

    autonomous: clearbugpriority: hightriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions