Quality: OpenRouter passthrough uses String-keyed HashMap — no type safety #105

Open
opened 2026-05-11 13:49:54 +00:00 by thabeta · 0 comments
Owner

Severity: Low

Location

crates/hero_aibroker_lib/src/providers/openrouter.rs and wire format handling

Finding

OpenRouter-specific parameters are passed through as HashMap<String, Value>:

  • No compile-time checking of parameter names
  • Typos in parameter names are silently ignored
  • No documentation of which parameters are supported
  • No validation of parameter values

Recommendation

  • Use typed structs for OpenRouter-specific parameters
  • Validate unknown keys and warn/error
  • Generate types from the OpenRouter OpenAPI spec
## Severity: Low ## Location `crates/hero_aibroker_lib/src/providers/openrouter.rs` and wire format handling ## Finding OpenRouter-specific parameters are passed through as `HashMap<String, Value>`: - No compile-time checking of parameter names - Typos in parameter names are silently ignored - No documentation of which parameters are supported - No validation of parameter values ## Recommendation - Use typed structs for OpenRouter-specific parameters - Validate unknown keys and warn/error - Generate types from the OpenRouter OpenAPI spec
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_aibroker#105
No description provided.