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

Introduces an OpenRouter-based agent (GLM-4.5V, UITARS) with shared computer-use helpers, tests, and full CLI/eval/factory integration.

  • Agents:
    • Add OpenRouterBaseAgent and OpenRouterAgent dispatcher with adapter registry/loader.
    • Implement adapters: Glm45vAgent (hud/agents/openrouter/models/glm45v) and UITarsAgent (hud/agents/openrouter/models/uitars) with prompt construction, response parsing, action conversion, and image handling; include action_space.txt.
    • Shared helpers in hud/agents/openrouter.py for reasoning/output items, computer-use actions, coordinate coercion, JSON action parsing, image extraction, and tool result rendering.
    • Export OpenRouterAgent in hud/agents/__init__.py.
  • CLI/Eval:
    • Add openrouter agent option and help text in hud/cli/__init__.py; include in valid choices and interactive selection.
    • Update hud/cli/eval.py to support openrouter in types/flows, normalize model, resolve adapter, and construct agent; wire API key via LiteLLM/OpenRouter.
  • Utils:
    • Add create_openrouter_agent factory in hud/utils/agent_factories.py.
  • Tests:
    • Add hud/agents/tests/test_openrouter.py covering default model selection, alias normalization, error on unknown model, message→tool-call parsing, and tool result formatting.

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

cursor[bot]

This comment was marked as outdated.

@promptless
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?

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

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