Skip to content

fix(router): handle Claude routing failures - #6

Merged
doedja merged 1 commit into
mainfrom
codex/fix-claude-stream-routing
Jul 29, 2026
Merged

fix(router): handle Claude routing failures#6
doedja merged 1 commit into
mainfrom
codex/fix-claude-stream-routing

Conversation

@doedja

@doedja doedja commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • normalize Claude's terminal [1m] marker before Kenari model lookup and forwarding
  • preserve native Claude model IDs unchanged
  • terminate downstream responses when an upstream stream aborts or closes early
  • add routing-matrix and interrupted-stream regression tests

Root cause

Claude Code can append [1m] to a configured role model. The router previously looked up the suffixed value literally, so kenari/minimax-m3[1m] failed even though minimax-m3 exists and supports a 1M context.

The response proxy also piped upstream data without handling response-side abort, error, or premature close events. A truncated upstream stream could leave Claude Code waiting until its five-minute stalled-response watchdog fired.

User impact

Claude Auto mode classifier requests can use 1M-capable Kenari role models. Interrupted parent or subagent streams fail immediately instead of remaining open for five minutes.

Validation

  • npm test: 91 passed, 0 failed
  • lowercase and uppercase [1m] markers
  • malformed non-terminal marker rejection
  • native model preservation
  • interrupted SSE propagation

Strip Claude's [1m] marker before Kenari catalog lookup.

Terminate downstream responses when upstream streams abort.
@doedja
doedja merged commit 005535d into main Jul 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant