Skip to content

Hardcoded 8s SDK timeout breaks dialectic queries at high/max reasoning levels #25

Description

@offendingcommit

Problem

The Honcho SDK client in the plugin is constructed with a hardcoded timeout: 8000 (8 seconds) in getHonchoClientOptions():

// src/config.ts, line ~756
export function getHonchoClientOptions(config: HonchoCLAUDEConfig): HonchoClientOptions {
  return {
    apiKey: config.apiKey,
    baseURL: getHonchoBaseUrl(config),
    workspaceId: config.workspace,
    timeout: 8000,
    maxRetries: 1,
  };
}

This timeout applies to the SDK's fetchWithTimeout() which wraps every HTTP request to the Honcho API with an AbortController. When a dialectic chat call uses high (4 tool iterations) or max (10 tool iterations) reasoning levels, the server-side processing regularly exceeds 8 seconds — especially with:

  • Local model backends (LM Studio, Ollama) where each LLM iteration takes 2-5s
  • Cloud providers (Gemini Flash/Pro) at higher iteration counts
  • Rich observation sets that require multiple search + reasoning cycles

The SDK's @honcho-ai/sdk has a DEFAULT_TIMEOUT of 60s, but the plugin overrides it to 8s.

Impact

  • honcho__chat with reasoning_level: "high" or "max" fails consistently with "Request timed out after 8000ms"
  • Users see this as an MCP timeout and investigate MCP_TOOL_TIMEOUT (red herring — the abort happens inside the SDK's fetch, not Claude Code's MCP client)
  • The actual server-side error is often a BadRequestError being retried by tenacity, which compounds the latency

Suggested Fix

Make the timeout configurable, or increase the default to something that accommodates multi-turn dialectic queries:

export function getHonchoClientOptions(config: HonchoCLAUDEConfig): HonchoClientOptions {
  return {
    apiKey: config.apiKey,
    baseURL: getHonchoBaseUrl(config),
    workspaceId: config.workspace,
    timeout: config.sdkTimeout ?? 30000, // or 60000 to match SDK default
    maxRetries: 1,
  };
}

Alternatively, allow per-tool timeouts so that chat (which does multi-turn reasoning) can have a longer timeout than data tools like search or create_conclusion.

Environment

  • Plugin version: 0.2.4
  • SDK version: @honcho-ai/sdk ^2.1.0
  • Honcho backend: local (Docker Compose) with LM Studio + Gemini hybrid config
  • Claude Code version: 2.1.92

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions