-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Issue Description
Content truncation logic in openrouter.rs is unreachable due to an early return check.
Location
crates/terraphim_service/src/openrouter.rs:168-172
Current Code
```rust
// Line 156: Early return if content too long
if content.len() > MAX_CONTENT_LENGTH {
return Err(...);
}
// Line 168-172: Unreachable truncation logic
let truncated_content = if content.len() > MAX_CONTENT_LENGTH {
&content[..MAX_CONTENT_LENGTH]
} else {
content
};
```
Impact
- MEDIUM priority - Dead code
- Confusing for maintainers
- Wastes compilation time
Recommended Fix
Either:
- Remove the early return to allow truncation
- Remove the truncation logic entirely
References
- Identified in code review for PR fix(zipsign): update zipsign API to v0.2 #429
- Related to OpenRouter LLM integration