Skip to content

[BUG] Kiro provider returns 400 "Improperly formed request" when used via Agent (OpenCode) #2113

Description

@tonvarex

OmniRoute Version

3.7.9

Installation Method

npm (global)

Operating System

Windows

OS Version

Windows 11

Node.js Version

22.22.2

Provider(s) Involved

Kiro

Model(s) Involved

kr/claude-opus-4.7, kr/claude-opus-4.6, kr/claude-sonnet-4.6, kr/claude-sonnet-4.5, kr/claude-haiku-4.5

Client Tool

OpenCode

Description

When using the Kiro provider through an agent (e.g., OpenCode), OmniRoute returns a 400 error with the message "Improperly formed request". However, the same provider and model work perfectly fine when used directly in the standard chat interface.

Steps to Reproduce

  1. Configure Kiro provider in OmniRoute.
  2. Select an agent (OpenCode) and attempt to run a task using a Kiro model (e.g., kr/claude-opus-4.7).
  3. Observe the 400 Improperly formed request error in the logs.
  4. Switch to the direct chat interface with the same model and observe that it works.

Expected Behavior

Agent requests should be formatted correctly and accepted by the Kiro provider, consistent with chat requests.

Actual Behavior

Agent requests fail with HTTP 400, leading to credential exhaustion/fallback.

Test Impact

Needs a new unit test

Error Logs / Output

[03:52:31.256] DEBUG: [sse] KIRO | claude-opus-4.7 | 3 msgs
[03:52:31.257] INFO: [sse] 0r5ckt pre_executor t=5ms {"attempt":0}
[ERROR] [400]: Improperly formed request.
❌ kiro [400]: [400]: Improperly formed request.
[03:52:31.639] INFO: [sse] 0r5ckt post_executor t=387ms {"status":400}
[03:52:31.660] WARN: [sse] Account df1fed88... unavailable (400), trying fallback

Screenshots

No response

Additional Context

No response

Validation Plan

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions