Skip to content

[Bug] agents-cli playground fails on Windows due to wildcard expansion of --allow_origins "*" #34

Closed

Description

@Abdullah-k0de

What happened?

Running agents-cli playground on Windows crashes with Error: Got unexpected extra arguments showing files from the current working directory.

Steps to Reproduce

  1. Create an agent project on Windows.
  2. Open a terminal inside the project root folder.
  3. Run agents-cli install
  4. Run agents-cli playground

What did you expect to happen?

The local playground server starts successfully and hosts the web UI at http://127.0.0.1:8080/dev-ui/

Client information

CLI version: 0.5.0
CLI install path: C:\Users\abdul\AppData\Roaming\uv\tools\google-agents-cli\Lib\site-packages\google\agents\cli
OS info: Windows-11-10.0.26200-SP0
Installed skills: none

Project root: C:\Users\abdul\OneDrive\Desktop\Comp Lang NEW\Antigravity - agy-cli-projects\weather-assistant
Project name: weather-assistant
Deployment target: none
Agent directory: app
Region: us-east1

Command Output / Logs

agents-cli playground
Starting your agent playground...
Running command: uv run adk web . --host 127.0.0.1 --port 8080 --allow_origins '*' --reload_agents
Will be available at: http://127.0.0.1:8080/dev-ui/?app=app
Usage: adk web [OPTIONS] [AGENTS_DIR]
Try 'adk web --help' for help.

Error: Got unexpected extra arguments (app Dockerfile GEMINI.md pyproject.toml README.md tests uv.lock)
agents-cli v0.5.0
Error: Failed to start playground (exit code 2)

Anything else we need to know?

Cause:

When Python launches the command via uv run, the adk.exe launcher wrapper (which is compiled with MSVC's setargv.obj) automatically expands the * wildcard in --allow_origins "*" into all filenames in the current directory before passing it to Python. Click then interprets these filenames as unexpected positional arguments.

Proposed Fix:

In google/agents/cli/dev/cmd_playground.py, escape/quote the asterisk argument on Windows to prevent the launcher's C runtime from expanding it:

     browser_host = "127.0.0.1" if host == "0.0.0.0" else host
     url = f"http://{browser_host}:{port}/dev-ui/?app={cfg.agent_directory}"
 
+    import sys
+    allow_origins = '"*"' if sys.platform == "win32" else "*"
     args = [
         "uv",
         "run",
@@ -66,7 +66,7 @@
         "--port",
         str(port),
         "--allow_origins",
-        "*",
+        allow_origins,
     ]
     if reload_agents:
         args.append("--reload_agents")


---

*Contribution & Recognition:*
*   I have signed the Google Individual CLA (under the name Abdullah).
*   Since this fix resolves a blocker for Windows users, I would appreciate being credited for this contribution when the fix is applied.
*   Once merged, I would also love to be nominated for the Google Open Source Peer Bonus program.

Activity

  1. changed the title [-]agents-cli playground fails on Windows due to wildcard expansion of --allow_origins "*"[/-] [+][Bug] agents-cli playground fails on Windows due to wildcard expansion of --allow_origins "*"[/+] on Jun 17, 2026
  2. self-assigned this
    on Jun 17, 2026
  3. sushicw commented on Jun 18, 2026

    @sushicw
    Contributor

    Thank you for the report!

    This actually appears to be an ADK cli bug, the same behavior occurs if you do uv run adk web . --host 127.0.0.1 --port 8080 --allow_origins '*' --reload_agents directly and don't involve agents-cli at all. A quoted * should not be getting expanded.

    In the meantime, we're adding a workaround in agents-cli to unblock Windows usage.

  4. Abdullah-k0de commented on Jun 18, 2026

    @Abdullah-k0de
    Author

    Thank you for the quick response and for self-assigning this!

    Yes, it is indeed an issue with how the compiled adk.exe launcher wrapper handles argument parsing/expansion on Windows. I'm glad the workaround will be added to agents-cli to unblock Windows users in the meantime.

    Also, I have just filed another issue regarding two other Windows-specific blockers in the agents-cli run local server lifecycle (a startup crash 0xc0000142 and a shutdown crash WNOHANG in _local_server.py), along with the proposed fixes.

    Since I've signed the CLA, I'm excited to contribute and help stabilize the Windows experience. I appreciate the support and would love to collaborate on future fixes/nominations!

  5. removed
    bugSomething isn't working
    on Jun 18, 2026
  6. added theissue type on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions