Skip to content

ACP / VS Code IDE Companion hook support is incomplete and not aligned with coreToolScheduler #3108

@yiliang114

Description

@yiliang114

What happened?

Hook support in the ACP / VS Code IDE Companion path is not aligned with the main core execution path. From the current source analysis, only the PermissionRequest hook is partially wired into ACP session permission handling. UserPromptSubmit, Stop, PreToolUse, PostToolUse, and PostToolUseFailure do not appear to run through the same hook flow as the core path.

In the ACP path, the session uses geminiClient.getChat() plus chat.sendMessageStream() to drive turns and tool execution directly, instead of going through GeminiClient.sendMessageStream() and CoreToolScheduler. As a result, even if hooks are configured in the VS Code IDE Companion flow, behavior appears inconsistent with the CLI / core path: permission-related hooks may have an effect, but the other hooks do not appear to trigger or are only partially supported.

What did you expect to happen?

Hook behavior in the ACP path should be consistent with the main core execution path. At minimum:

  • UserPromptSubmit and Stop should also run in ACP sessions.
  • PreToolUse, PostToolUse, and PostToolUseFailure should be triggered during ACP tool execution.
  • VS Code IDE Companion should correctly support the interactions or state updates required by those hooks.

If partial hook support in the ACP / VS Code path is intentional, the implementation boundary should be documented clearly so it does not look like a silent behavior mismatch.

Client information

Client Information
  • qwen-code version: 0.14.2
  • vscode-ide-companion version: 0.14.2
  • Node.js: v22.22.0
  • OS: macOS 15.1.1 (Darwin 24.1.0 arm64)
  • analyzed source commit: c0793316c

Anything else we need to know?

Based on the current source analysis, the relevant implementation paths include:

  • packages/core/src/core/client.ts, where UserPromptSubmit and Stop hooks are attached to GeminiClient.sendMessageStream().
  • packages/cli/src/acp-integration/acpAgent.ts and packages/cli/src/acp-integration/session/Session.ts, where ACP sessions use geminiClient.getChat().sendMessageStream() directly and do not go through that hook entry point.
  • packages/core/src/core/coreToolScheduler.ts, which implements PreToolUse, PostToolUse, and PostToolUseFailure.
  • ACP Session.runTool(), which currently wires in PermissionRequest hook handling but not the full tool lifecycle hooks.
  • The ACP schema / VS Code companion flow, which currently handles standard sessionUpdate events and requestPermission, but does not expose a hook-specific update channel.

Metadata

Metadata

Assignees

Labels

status/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expected

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions