Skip to content

[Bug]: Kimi Code provider transport error - failed to send request #7

@louisdevzz

Description

@louisdevzz

Summary

Kimi Code provider fails to send requests to API endpoint, causing agent to hang during tool execution.

Problem Statement

When using the kimi-code provider with model kimi-k2.5, the provider call fails with a transport error:

Provider call failed, retrying provider="kimi-code" model="kimi-k2.5" attempt=1 backoff_ms=500 reason="retryable" error=Kimi Code native chat transport error: error sending request for url (https://api.kimi.com/coding/v1/chat/completions) (responses fallback failed: Kimi Code Responses API error: {"error":{"message":"T...

This error occurs during normal agent operation when executing sandbox commands, causing the workflow to hang indefinitely.

Image

Steps to Reproduce

  1. Configure kimi-code as the provider with model kimi-k2.5
  2. Start the agent with any channel (Signal, Telegram, etc.)
  3. Send a message requesting to build a project (e.g., "build a coffee landing page")
  4. Agent calls sandbox_create successfully
  5. Agent calls sandbox_run_command to initialize project
  6. Provider fails when trying to continue the conversation

Expected Behavior

  • Provider should successfully send requests to https://api.kimi.com/coding/v1/chat/completions
  • If the API fails, it should fail fast with a clear error message instead of hanging
  • Fallback mechanism should work correctly

Actual Behavior

  • Transport error occurs when sending request to Kimi Code API
  • Retry mechanism kicks in but continues to fail
  • Agent hangs waiting for provider response

Environment

  • Provider: kimi-code
  • Model: kimi-k2.5
  • ZeroBuild version: latest
  • OS: macOS (from log paths /var/folders/...)

Proposed Solution

  1. Investigate the Kimi Code provider's HTTP client configuration
  2. Add proper timeout handling to prevent indefinite hangs
  3. Improve error handling and logging for transport errors
  4. Consider adding circuit breaker pattern for failing providers

Non-goals / Out of Scope

  • Changing the underlying Kimi API
  • Supporting other Kimi models beyond k2.5

Acceptance Criteria

  • Kimi Code provider successfully sends requests without transport errors
  • Clear error message is shown when API is unavailable
  • Agent does not hang when provider fails
  • Retry logic has maximum attempt limit with backoff

Architecture Impact

  • Affects: src/providers/ module
  • May require changes to error handling in provider trait

Risk and Rollback

Risk: Low - This is a bug fix for existing functionality
Rollback: Revert provider changes if issues arise

Breaking Change

No breaking changes expected.

Data Hygiene Checks

  • No sensitive data (API keys, tokens) in logs
  • Error messages don't expose internal URLs or credentials

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingprovider

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions