Skip to content

Windows chat hangs with acpx 0.12.0 and ChatGPT auth due to cmd spawning, model selection, and JSON-RPC parsing #7

Description

@cr4shboy

OpenClaw VS Code extension 0.2.1 does not work on Windows with acpx 0.12.0 and ChatGPT authentication

Summary

After installing the OpenClaw VS Code extension and configuring ChatGPT authentication through Codex, the chat panel did not work on Windows.

Sending a message caused the chat to remain indefinitely in the STOP state without returning a response.

The issue involved three separate compatibility problems between:

  • Windows
  • openknot.openclaw-extension version 0.2.1
  • acpx version 0.12.0
  • Codex authenticated through a ChatGPT account

After applying three local patches to the compiled extension code, the chat began working correctly and returned pong for a test prompt.

Environment

  • OS: Windows 11 x64
  • VS Code extension: openknot.openclaw-extension@0.2.1
  • OpenClaw CLI: 2026.7.1
  • acpx: 0.12.0
  • Authentication: ChatGPT account through Codex
  • Workspace: local Windows development repository

The extension was installed under the standard VS Code extensions directory:

%USERPROFILE%\.vscode\extensions\openknot.openclaw-extension-0.2.1

The compiled extension file was:

%USERPROFILE%\.vscode\extensions\openknot.openclaw-extension-0.2.1\out\extension.js

Expected behavior

After installing the extension, installing acpx globally, authenticating Codex with ChatGPT, and sending a prompt such as:

ping

the chat should return:

pong

and complete normally.

Actual behavior

The OpenClaw chat panel remained indefinitely in the STOP state.

Initially, no visible error appeared in the chat panel.

The OpenClaw Agent output channel showed:

spawn acpx --format json --approve-reads exec ping

The process did not return a visible response.

Investigation

1. Direct Windows spawn of acpx failed

The extension originally used:

spawn("acpx", args, ...)

On Windows, acpx is installed through npm and exposed as:

acpx.cmd

A raw Node.js child process spawn could not resolve or execute it correctly.

Testing showed that:

spawn("acpx", ...)

failed with:

ENOENT

and Windows error code:

-4058

Changing it to:

spawn("acpx.cmd", ...)

allowed the process to be found, but direct execution was still unreliable.

A direct Node.js test using:

spawn("acpx.cmd", ...)

failed with:

Error: spawn EINVAL
errno: -4071
code: EINVAL
syscall: spawn

This indicates that directly spawning an npm .cmd wrapper on Windows is not reliable in this context.

Fix 1: execute acpx through cmd.exe

The extension spawn logic was changed from:

spawn("acpx", args, {
  cwd,
  env: { ...process.env },
  stdio: ["ignore", "pipe", "pipe"]
});

to:

spawn(
  process.env.ComSpec,
  ["/d", "/s", "/c", "acpx.cmd", ...args],
  {
    cwd,
    env: { ...process.env },
    stdio: ["ignore", "pipe", "pipe"]
  }
);

After this change, the process started and exited normally.

The output then showed:

spawn acpx --format json --model gpt-5.5[medium] --approve-reads exec ping
acpx exited code=0

2. The default Codex model was not supported with ChatGPT authentication

Running the same command manually exposed the second issue:

acpx.cmd --format json --approve-reads exec ping

The ACP session selected:

gpt-5.3-codex[medium]

The response contained:

{
  "type": "invalid_request_error",
  "message": "The 'gpt-5.3-codex' model is not supported when using Codex with a ChatGPT account."
}

The local Codex configuration already specified a different model, but acpx did not use it for the ACP session and instead selected its own default model.

Testing with an explicitly selected supported model worked:

acpx.cmd --model "gpt-5.5[medium]" --format json --approve-reads exec ping

This returned:

pong

Fix 2: pass a supported model explicitly

The extension argument builder was changed from:

args.push("--format", "json");

to:

args.push(
  "--format",
  "json",
  "--model",
  "gpt-5.5[medium]"
);

This made the session use a model supported by ChatGPT authentication.

A better permanent solution would be to expose a model setting in the extension:

"openclaw.chat.model": {
  "type": "string",
  "default": "",
  "description": "ACP model ID to use for chat sessions"
}

Suggested logic:

const model = config.get("chat.model", "");

if (model) {
  args.push("--model", model);
}

The extension should not assume that the default Codex model is compatible with every authentication method.

3. The extension parser did not support the current acpx JSON-RPC response format

After fixing process execution and model selection, acpx exited successfully with code 0, but no response appeared in the chat panel.

Manual command output showed that acpx 0.12.0 returns assistant text through JSON-RPC notifications in this format:

{
  "jsonrpc": "2.0",
  "method": "session/update",
  "params": {
    "sessionId": "<redacted>",
    "update": {
      "sessionUpdate": "agent_message_chunk",
      "content": {
        "type": "text",
        "text": "pong"
      }
    }
  }
}

The extension parser expected event types at the top level:

let type = event.type;

It did not unwrap:

event.params.update

and did not recognize:

agent_message_chunk

As a result, the valid response was silently ignored.

Fix 3: support session/update and agent_message_chunk

The parser was changed from:

mapJsonEvent(event) {
  let type = event.type;

to equivalent logic:

mapJsonEvent(event) {
  if (
    event?.method === "session/update" &&
    event.params?.update
  ) {
    event = event.params.update;
  }

  const type = event.sessionUpdate ?? event.type;

  if (type === "agent_message_chunk") {
    const text =
      event.content?.text ??
      event.content ??
      "";

    return text
      ? { type: "text", text }
      : null;
  }

After this patch, the chat correctly displayed:

pong

Final working behavior

After applying all three fixes and restarting VS Code:

spawn acpx --format json --model gpt-5.5[medium] --approve-reads exec ping
acpx exited code=0

The chat panel displayed:

pong

and the task completed normally.

Required fixes

1. Windows process invocation

On Windows, do not directly spawn npm .cmd wrappers.

Use:

spawn(
  process.env.ComSpec,
  ["/d", "/s", "/c", "acpx.cmd", ...args],
  options
);

or another properly tested equivalent with safe argument escaping.

Using cmd.exe explicitly is more deterministic than relying on Node.js to resolve .cmd wrappers.

2. Configurable ACP model

The extension should allow the ACP model to be configured.

Suggested setting:

"openclaw.chat.model": {
  "type": "string",
  "default": "",
  "description": "Model ID passed to acpx through --model"
}

Suggested logic:

const model = config.get("chat.model", "");

if (model) {
  args.push("--model", model);
}

The extension should not assume that the default Codex model is compatible with every authentication method.

3. Current acpx JSON-RPC support

The parser should support JSON-RPC notifications from acpx 0.12.0, especially:

session/update
agent_message_chunk
usage_update
available_commands_update

At minimum, the extension should unwrap:

event.params.update

and map:

agent_message_chunk

to a visible text event.

4. Better error reporting

The extension should surface nested agent errors such as:

{
  "sessionUpdate": "agent_message_chunk",
  "content": {
    "type": "text",
    "text": "{\"type\":\"error\", ...}"
  }
}

Currently, such errors can be silently ignored or rendered as normal assistant text.

A failed model selection should be shown clearly in the chat panel instead of leaving the task indefinitely in the STOP state.

Additional observation

The extension creates two separate output channels:

OpenClaw
OpenClaw Agent

The actual chat process logs are written to:

OpenClaw Agent

This is not obvious during troubleshooting.

It may be useful to document this or consolidate the output channels.

Workaround

The local workaround was applied directly to:

%USERPROFILE%\.vscode\extensions\openknot.openclaw-extension-0.2.1\out\extension.js

This is only temporary.

Any extension update or reinstall will overwrite the modifications.

Conclusion

The default extension did not work with the following setup:

Windows
VS Code extension 0.2.1
acpx 0.12.0
Codex authenticated through ChatGPT

The failure was caused by three independent compatibility issues:

  1. incorrect execution of the Windows npm .cmd wrapper;
  2. unsupported default model selection for ChatGPT authentication;
  3. outdated parsing of the current acpx JSON-RPC event format.

After fixing all three areas, the OpenClaw chat worked correctly.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions