What happened?
The Gemini Code Assist Agent fails to initialize and enters an infinite restart loop on macOS with M4 Pro architecture. While the standard chat works, the "Expanded Access" (Agent) mode crashes immediately with invalid_grant and Exit Code 41.
Crucial Observation: The same account works perfectly on Windows. Manually running the agent server from the terminal bypasses the issue, suggesting a child-process spawning or interactive consent handling bug in the extension's binary for Apple Silicon.
Environment
- OS: macOS 15.7.4
- Hardware: MacBook Pro (M4 Pro Chip)
- VS Code Version: 1.112.0
- Extension Version: v2.75.0
- gcloud SDK Version: Google Cloud SDK 561.0.0
Steps to Reproduce
- Enable "Expanded Access" (Agent) in Gemini settings.
- Watch the "Gemini Code Assist - Agent" output log.
- The process crashes, restarts, and causes high CPU usage/fan activity.
Logs:
Starting background process... Background process started with PID 65211 (node:65211) [DEP0040] DeprecationWarning: The punycodemodule is deprecated. Please use a userland alternative instead. (UseCode Helper (Plugin) --trace-deprecation ... to show where the warning was created) Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. [WARN] Skipping unreadable directory: /Library/Trial (EPERM: operation not permitted, scandir '/Library/Trial') [WARN] Skipping unreadable directory: /dev/fd (EBADF: bad file descriptor, lstat '/dev/fd/11') [WARN] Skipping unreadable directory: /Library/Application Support/com.apple.TCC (EPERM: operation not permitted, scandir '/Library/Application Support/com.apple.TCC') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.amsengagementd.classicdatavault (EPERM: operation not permitted, scandir '/Library/Caches/com.apple.amsengagementd.classicdatavault') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.aneuserd (EPERM: operation not permitted, scandir '/Library/Caches/com.apple.aneuserd') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.aned (EPERM: operation not permitted, scandir '/Library/Caches/com.apple.aned') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.iconservices.store (EACCES: permission denied, scandir '/Library/Caches/com.apple.iconservices.store') Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. Hook registry initialized with 0 hook entries Hook system initialized successfully [STARTUP] StartupProfiler.flush() called with 1 phases [STARTUP] Recording metric for phase: discover_tools duration: 487.664333 [INFO] 2026-03-18 23:35:08.516 PM -- [Config] Using CCPA Auth: Cached credentials are not valid: invalid_grant [ERROR] 2026-03-18 23:35:08.673 PM -- [CoreAgent] Error during startup: Interactive consent could not be obtained. Please run Gemini CLI in an interactive terminal to authenticate, or use NO_BROWSER=true for manual authentication. { "exitCode": 41, "stack": "Error: Interactive consent could not be obtained.\nPlease run Gemini CLI in an interactive terminal to authenticate, or use NO_BROWSER=true for manual authentication.\n at getConsentForOauth (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:322349:13)\n at initOauthClient (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:322515:31)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async createCodeAssistContentGenerator (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:334212:24)\n at async file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:334449:42\n at async createContentGenerator (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:334428:21)\n at async Config.refreshAuth (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:406151:29)\n at async refreshAuthentication (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:407780:5)\n at async loadConfig (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:407713:3)\n at async createApp (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:410011:21)" } Process exited with code 1 and signal null Process exited for restart, attempting to restart...
Manual Workaround (Proof of Bug)
The agent starts successfully only if manually executed from the terminal using:
cd ~/.vscode/extensions/google.geminicodeassist-2.75.0/agent && export USE_CCPA=true && node a2a-server.mjs --login
This proves the issue is in how the extension host attempts to launch the background process and handle OAuth consent on this specific macOS/Hardware combo.
Attempted Fixes (All Failed)
- Reinstalling gcloud SDK (tar.gz and Brew).
- Moving the workspace out of ~/Documents (TCC bypass).
- Clearing macOS Keychain and manually adding vsc-google-cloud-auth entry.
- Using VS Code Insiders (identical failure).
What did you expect to happen?
/
Client information
Client Information
Run gemini to enter the interactive CLI, then run the /about command.
> /about
# paste output here
Login information
No response
Anything else we need to know?
No response
What happened?
The Gemini Code Assist Agent fails to initialize and enters an infinite restart loop on macOS with M4 Pro architecture. While the standard chat works, the "Expanded Access" (Agent) mode crashes immediately with invalid_grant and Exit Code 41.
Crucial Observation: The same account works perfectly on Windows. Manually running the agent server from the terminal bypasses the issue, suggesting a child-process spawning or interactive consent handling bug in the extension's binary for Apple Silicon.
Environment
Steps to Reproduce
Logs:
Starting background process... Background process started with PID 65211 (node:65211) [DEP0040] DeprecationWarning: Thepunycodemodule is deprecated. Please use a userland alternative instead. (UseCode Helper (Plugin) --trace-deprecation ...to show where the warning was created) Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. [WARN] Skipping unreadable directory: /Library/Trial (EPERM: operation not permitted, scandir '/Library/Trial') [WARN] Skipping unreadable directory: /dev/fd (EBADF: bad file descriptor, lstat '/dev/fd/11') [WARN] Skipping unreadable directory: /Library/Application Support/com.apple.TCC (EPERM: operation not permitted, scandir '/Library/Application Support/com.apple.TCC') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.amsengagementd.classicdatavault (EPERM: operation not permitted, scandir '/Library/Caches/com.apple.amsengagementd.classicdatavault') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.aneuserd (EPERM: operation not permitted, scandir '/Library/Caches/com.apple.aneuserd') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.aned (EPERM: operation not permitted, scandir '/Library/Caches/com.apple.aned') [WARN] Skipping unreadable directory: /Library/Caches/com.apple.iconservices.store (EACCES: permission denied, scandir '/Library/Caches/com.apple.iconservices.store') Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. Ignore file not found: /.geminiignore, continue without it. Ignore file not found: /.aiexclude, continue without it. Hook registry initialized with 0 hook entries Hook system initialized successfully [STARTUP] StartupProfiler.flush() called with 1 phases [STARTUP] Recording metric for phase: discover_tools duration: 487.664333 [INFO] 2026-03-18 23:35:08.516 PM -- [Config] Using CCPA Auth: Cached credentials are not valid: invalid_grant [ERROR] 2026-03-18 23:35:08.673 PM -- [CoreAgent] Error during startup: Interactive consent could not be obtained. Please run Gemini CLI in an interactive terminal to authenticate, or use NO_BROWSER=true for manual authentication. { "exitCode": 41, "stack": "Error: Interactive consent could not be obtained.\nPlease run Gemini CLI in an interactive terminal to authenticate, or use NO_BROWSER=true for manual authentication.\n at getConsentForOauth (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:322349:13)\n at initOauthClient (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:322515:31)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async createCodeAssistContentGenerator (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:334212:24)\n at async file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:334449:42\n at async createContentGenerator (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:334428:21)\n at async Config.refreshAuth (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:406151:29)\n at async refreshAuthentication (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:407780:5)\n at async loadConfig (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:407713:3)\n at async createApp (file:///Users/savafilipovic/.vscode/extensions/google.geminicodeassist-2.75.0/agent/a2a-server.mjs:410011:21)" } Process exited with code 1 and signal null Process exited for restart, attempting to restart...Manual Workaround (Proof of Bug)
The agent starts successfully only if manually executed from the terminal using:
cd ~/.vscode/extensions/google.geminicodeassist-2.75.0/agent && export USE_CCPA=true && node a2a-server.mjs --loginThis proves the issue is in how the extension host attempts to launch the background process and handle OAuth consent on this specific macOS/Hardware combo.
Attempted Fixes (All Failed)
What did you expect to happen?
/
Client information
Client Information
Run
geminito enter the interactive CLI, then run the/aboutcommand.Login information
No response
Anything else we need to know?
No response