Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/shared/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export const getModelMaxOutputTokens = ({
settings?: ProviderSettings
format?: "anthropic" | "openai" | "gemini" | "openrouter"
}): number | undefined => {
// Special-case: Slack request to cap OpenRouter horizon-alpha default output to 32k
// Only applies when routed via OpenRouter and the model id is exactly "openrouter/horizon-alpha"
if (format === "openrouter" && modelId === "openrouter/horizon-alpha") {
return 32_000
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test coverage for this new special case logic. Could you add a test case to that verifies this function returns 32,000 when and ? The existing test suite has comprehensive coverage for other scenarios but lacks this specific combination.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we consider extracting this magic number to a named constant? Something like would improve maintainability if this value needs to be referenced elsewhere or changed in the future.

}

// Check for Claude Code specific max output tokens setting
if (settings?.apiProvider === "claude-code") {
return settings.claudeCodeMaxOutputTokens || CLAUDE_CODE_DEFAULT_MAX_OUTPUT_TOKENS
Expand Down