Files
OmniRoute/tests
valvesss b5ef904b94 fix(cursor-image): allowlist CLI model + clamp request timeout (PR #8338 review)
Two mechanical hardening fixes requested in review:

- Model: the request's `model=cursor/<…>` flowed unfiltered into the Agent CLI
  `--model` argv. Add resolveCursorImageModel() — an allowlist derived from
  IMAGE_PROVIDERS.cursor.models (auto | composer-2 | composer-2.5), mirroring the
  auggie executor. Unknown or flag-shaped values fall back to "auto" and never
  reach argv. Operator overrides (connection psd / CURSOR_IMG_MODEL) stay trusted.

- Timeout: request `timeout_ms` had no upper bound while the shared Cursor seat
  has only CURSOR_IMG_MAX_CONCURRENT (default 2) slots. Add
  resolveCursorImageTimeoutMs() clamping the caller value to MAX_TIMEOUT_MS
  (300000ms); the operator default (CURSOR_IMG_TIMEOUT_MS) stays uncapped.

Tests: +3 (12/12) — allowlist unit test, end-to-end proof a flag-shaped model
resolves to "auto" in argv, and the timeout clamp.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-20 08:57:50 -03:00
..