Correctness: Router has todo!() panics for non-chat operations #78

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

Severity: Critical

Location

crates/hero_aibroker_lib/src/service/router.rsRouter::route()

Finding

The main routing function panics on non-chat operations:

match op {    ModelOperation::Chat(_) => { ... }
    ModelOperation::Transcribe(_) => { todo!("transcribe") }
    ModelOperation::TextToSpeech(_) => { todo!("tts") }
    ModelOperation::Embed(_) => { todo!("embed") }
    ModelOperation::GenerateImage(_) => { todo!("image") }
}```

## Impact
- Any request to transcribe, TTS, embedding, or image endpoints causes a full process panic
- The broker crashes and must be restarted
- All in-flight requests are dropped

## Recommendation
- Implement all operation types or return proper 501 Not Implemented errors
- Remove `todo!()` macros from production code paths
- Add integration tests that exercise each operation type
## Severity: Critical ## Location `crates/hero_aibroker_lib/src/service/router.rs` — `Router::route()` ## Finding The main routing function panics on non-chat operations: ```rust match op { ModelOperation::Chat(_) => { ... } ModelOperation::Transcribe(_) => { todo!("transcribe") } ModelOperation::TextToSpeech(_) => { todo!("tts") } ModelOperation::Embed(_) => { todo!("embed") } ModelOperation::GenerateImage(_) => { todo!("image") } }``` ## Impact - Any request to transcribe, TTS, embedding, or image endpoints causes a full process panic - The broker crashes and must be restarted - All in-flight requests are dropped ## Recommendation - Implement all operation types or return proper 501 Not Implemented errors - Remove `todo!()` macros from production code paths - Add integration tests that exercise each operation type
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#78
No description provided.