Skip to content

Conversation

shfunc
Copy link

@shfunc shfunc commented Oct 9, 2025

  • Adds OpenRouterAgent (Responses API): message/role mapping, tool-call conversion, prompt caching, schema sanitization, and image handling (testing).
  • Basic tests pass; included a tiny OpenRouter quickstart example (inline task).
  • Differences across agents: OpenAI-compatible uses Chat Completions; OpenRouter uses Responses adapter; both share the same MCPAgent interface.

Can be tested with these commands:

python examples/04_openrouter_quickstart.py

hud eval hud-evals/SheetBench-50 openrouter --model z-ai/glm-4.5v -v

Note

Introduce OpenRouterAgent (via GLM-4.5V adapter) with computer-use tooling, add CLI/eval support and tests, plus a minimal MCP sum server example.

  • Agents:
    • OpenRouter integration: Add hud/agents/openrouter.py (agent facade + shared computer-use helpers) and register in hud/agents/__init__.py.
    • GLM-4.5V adapter: Implement Glm45vAgent (hud/agents/glm45v.py) with action parsing, image handling, and MCP tool-call conversion.
  • CLI/Eval:
    • Add openrouter agent option across hud/cli/__init__.py and hud/cli/eval.py (prompt/validation, build/run paths, dataset/group modes).
    • Resolve OpenRouter models to adapters; pass through allowed_tools, verbosity, and model names.
  • Utils:
    • Add create_openrouter_agent factory (hud/utils/agent_factories.py).
  • Tests:
    • New tests for OpenRouter adapter dispatch and tool-call parsing (hud/agents/tests/test_openrouter.py).
  • Examples:
    • Add examples/mcp_sum_server.py (minimal FastMCP sum tool server).
  • Deps:
    • Relax dev dependency pin for litellm in pyproject.toml.

Written by Cursor Bugbot for commit 45fe54e. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

promptless bot commented Oct 9, 2025

📝 Documentation updates detected!

Updated existing suggestion: Add and update OpenRouter agent documentation for PR #163 and PR #166

cursor[bot]

This comment was marked as outdated.

@shfunc
Copy link
Author

shfunc commented Oct 11, 2025

  • added the glm-4.5v computer-use adapter (prompt glue + action parser) and updated the
    openrouter wrapper to dispatch to it
  • adjusted the openrouter unit test to mock litellm, check the decoded openai_computer tool
    call, and cover tool-result formatting
  • bumped the agent dependency to litellm

Have a couple of questions: Do we want to keep model-specific adapters in separate top-level modules
(like the new glm45v.py), or should we group them under an openrouter/ subpackage so adding
more models stays organized?

}
if allowed_tools:
agent_config["allowed_tools"] = allowed_tools

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: OpenRouter Agent Mode Handling Inconsistency

The OpenRouter agent is handled inconsistently between single task and full dataset modes. Full dataset mode bypasses the OpenRouterAgent wrapper, directly instantiating an internal adapter and manually normalizing model names. This creates different behavior paths and model name formatting compared to single task mode, which uses the wrapper as intended.

Fix in Cursor Fix in Web

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.

1 participant