Skip to content

fix/lmstudio-numeric-password-mcp - #172

Open
david-hummingbot wants to merge 5 commits into
mainfrom
fix/lmstudio-numeric-password-mcp
Open

fix/lmstudio-numeric-password-mcp#172
david-hummingbot wants to merge 5 commits into
mainfrom
fix/lmstudio-numeric-password-mcp

Conversation

@david-hummingbot

Copy link
Copy Markdown
Contributor

Summary

  • Coerce Hummingbot MCP username/password (and related CLI args) to strings when building stdio server configs, so YAML-loaded numeric credentials (e.g. password: 123456) don’t break agent startup.
  • Harden PydanticAIClient by stringifying MCP args/env before StdioServerParameters validation — the failure path used by lmstudio: / ollama: / other pydantic-ai backends.
  • Add a regression test covering numeric username/password credentials in MCP args.

Root cause

Unquoted numeric passwords in config.yml (often written by setup-environment.sh) load as int. Starting an LM Studio (pydantic-ai) session validates MCP args strictly and fails with:

StdioServerParameters.args.9 … input_value=123456, input_type=int

ACP agents don’t hit the same validation, so the bug mainly shows up with local LLMs.

Test plan

  • Set servers.local.password: 123456 (unquoted) in config.yml, restart Condor, start /agent with LM Studio — session should start (no StdioServerParameters error)
  • Confirm Claude/ACP agent start still works
  • Restore a real password afterward

Ensure all arguments and environment variables are strings.
Refactor to use _hummingbot_mcp_args for argument construction.
Add test for handling numeric credentials in MCP args.
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

The PR prevents numeric YAML credentials and other non-string MCP values from failing pydantic-ai stdio server validation.

  • Stringifies MCP subprocess arguments and environment keys/values before constructing MCPServerStdio.
  • Centralizes Hummingbot MCP argument construction and explicitly converts credentials and server identifiers to strings.
  • Adds regression coverage for numeric Hummingbot usernames and passwords.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

The reachable MCP configuration builders produce valid argument and environment shapes, and the new coercion aligns their values with the downstream stdio and CLI string contracts.

Important Files Changed

Filename Overview
condor/acp/pydantic_ai_client.py Normalizes MCP arguments and environment data to strings before pydantic-ai validation; no reachable regression was identified.
handlers/agents/_shared.py Extracts Hummingbot argument construction and ensures credential-related CLI values are strings.
tests/test_agents.py Adds focused regression coverage proving numeric YAML-style credentials become valid string arguments.

Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/lmstudio-nu..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants