Can not write file when space User Profile at plugins\googlecloudtools.datacloud_telemetry

● Create(~/Desktop/LLM-Wiki/issues/…v_buffer_nameerror_time.md) (ctrl+o to expand)

Since the current system’s Plugin Hook has an issue with spaces in the path (C:\Users\TUF A15…),
it is unable to write files directly to disk via the tool.

Hi @Suphot_sam

Could you please clarify the issue you are facing in more detailed way, so we can continue reproduction from our side.

Bug Report: Tool Execution Failure on Windows User Profile with Whitespaces (C:\Users\TUF A15) caused by googlecloudtools.datacloud_telemetry Plugin Hook

  • Environment: Windows 11 / Windows 10 (64-bit)
  • User Profile Path: C:\Users\TUF A15 (Contains embedded space 0x20)
  • Target Repository: C:\Users\TUF A15\Desktop\LLM-Wiki
  • Failing Plugin Hook: googlecloudtools.datacloud_telemetry (PreToolUse Hook)
  • Plugin Hook Config: %USERPROFILE%\.gemini\config\plugins\googlecloudtools.datacloud_telemetry\hooks.json
  • Hook Bundle Script: %USERPROFILE%\.gemini\config\plugins\googlecloudtools.datacloud_telemetry\telemetry_hook_bundle.js
  • Affected Tools: All tools (matcher: "*"), including Create(...), write_to_file, replace_file_content, etc.
  • Date Reported: 2026-08-21
  • Status: Open / Reproduction Details for Development Team

1. Problem Description

When an automated developer tool or IDE subagent attempts to execute any tool (e.g. Create(~/Desktop/LLM-Wiki/issues/...md)), the operation is intercepted and blocked by the PreToolUse plugin hook of googlecloudtools.datacloud_telemetry.

Because the user profile directory contains whitespace (C:\Users\TUF A15), the generated hook command fails during Windows shell tokenization, causing the entire tool execution to abort with:

● Create(~/Desktop/LLM-Wiki/issues/…v_buffer_nameerror_time.md) (ctrl+o to expand)

Since the current system’s Plugin Hook has an issue with spaces in the path (C:\Users\TUF A15…),
it is unable to write files directly to disk via the tool.

Underlying Shell Error Trace:

'C:\Users\TUF' is not recognized as an internal or external command,
operable program or batch file.
# OR
node: can't open file 'C:\Users\TUF': [Errno 2] No such file or directory


2. Root Cause Analysis

2.1 Plugin Hook Configuration (hooks.json)

The telemetry plugin registers a global PreToolUse hook with matcher * in:
C:\Users\TUF A15\.gemini\config\plugins\googlecloudtools.datacloud_telemetry\hooks.json

{
  "googlecloudtools.datacloud_telemetry": {
    "enabled": true,
    "PreToolUse": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "node C:\\Users\\TUF A15\\.gemini\\config\\plugins\\googlecloudtools.datacloud_telemetry\\telemetry_hook_bundle.js --agent_name gemini --install_source \"Visual Studio Code\" ; exit 0",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

2.2 Shell Argument Tokenization Breakdown

  1. Unquoted String Execution: The IDE plugin runner passes the raw command string to cmd.exe or powershell.exe.
  2. Whitespace Splitting: cmd.exe splits the path at the space between TUF and A15:
    • node attempts to execute script C:\Users\TUF
    • A15\.gemini\... is parsed as an invalid command argument
  3. Pre-Tool Hook Failure: Because the PreToolUse hook exits with an error or fails to launch, the tool execution lifecycle is aborted before the tool (Create / write_to_file) can write to disk.

3. Steps to Reproduce

  1. On a Windows workstation, use or create a user profile with spaces in the folder name (e.g. C:\Users\TUF A15).
  2. Ensure the plugin googlecloudtools.datacloud_telemetry is installed under %USERPROFILE%\.gemini\config\plugins\.
  3. Configure hooks.json with an unquoted path in the command property:
    node C:\Users\TUF A15\.gemini\config\plugins\googlecloudtools.datacloud_telemetry\telemetry_hook_bundle.js ...
  4. In the IDE, ask the agent to create or edit a file (triggering any tool with PreToolUse).
  5. Observed Result: Tool fails with “Plugin Hook has an issue with spaces in the path” and 'C:\Users\TUF' is not recognized.

4. Suggested Fixes for the Development Team

  1. Auto-Quote Plugin Hook Command Generator:
    Ensure the IDE/CLI configuration generator automatically wraps paths containing %USERPROFILE% in escaped double quotes when generating hooks.json:

    "command": "node \"C:\\Users\\TUF A15\\.gemini\\config\\plugins\\googlecloudtools.datacloud_telemetry\\telemetry_hook_bundle.js\" --agent_name gemini --install_source \"Visual Studio Code\" ; exit 0"
    
    
  2. Array-Based Hook Invocation (spawn without shell):
    Instead of executing hook commands as a single shell string (cmd.exe /c "..."), invoke Node.js directly using parameter arrays:

    spawn('node', [
      path.join(pluginDir, 'telemetry_hook_bundle.js'),
      '--agent_name', 'gemini',
      '--install_source', 'Visual Studio Code'
    ], { shell: false });
    
    
  3. Fallback to Windows 8.3 Short Path (SFN):
    When generating hook configs on Windows, resolve %USERPROFILE% to its 8.3 short path representation (e.g. C:\Users\TUFA15~1\...) as a defensive measure.


5. Temporary Workarounds for Users

  • Workaround 1 (Disable Plugin): Set "enabled": false in hooks.json.
  • Workaround 2 (Short Path): Replace C:\Users\TUF A15 with C:\Users\TUFA15~1 in hooks.json.
  • Workaround 3 (Directory Junction): Create an unspaced junction: mklink /J C:\UserTUF "C:\Users\TUF A15".