Skip to content

Raise default chunk timeout 45s → 180s so healthy slow generations aren't interrupted #38

Closed

Description

@famewolf

Summary

Silence-based stall detection misfires on healthy but slow generations.
DEFAULT_CHUNK_TIMEOUT_MS is 45_000 and gracePeriodMs defaults to 3_000, so a
busy session that emits no events for 48 seconds gets a synthetic "continue"
(the README: "If no events arrive for 48 seconds (chunkTimeoutMs +
gracePeriodMs), the plugin sends "continue" with exponential backoff").

On models with long thinking blocks or slow streaming, 48 seconds is well inside
a healthy generation. Observed locally: a 27B with thinking enabled regularly
goes silent past 60s on one shared GPU, so the plugin interrupts a session that
is making progress and discards its in-flight turn. The v2 port (PR #37) shipped
the same 45s default, so it should be fixed in both for consistency.

Proposed change

- const DEFAULT_CHUNK_TIMEOUT_MS = 45_000
+ const DEFAULT_CHUNK_TIMEOUT_MS = 180_000

plus updating the README prose to match (48 seconds → ~3 minutes).

Notes

  • chunkTimeoutMs stays a plugin option (options?.chunkTimeoutMs ?? DEFAULT_CHUNK_TIMEOUT_MS, src/index.ts L493) — anyone who explicitly set a
    value is unaffected; users who want aggressive recovery can set 45_000 or
    busyStallStrategy: "abort".
  • Recovery is deferred, not lost: the "continue" still fires with the existing
    exponential backoff and 3-retry ceiling once a session is genuinely silent
    past the window.
  • If you'd rather keep the default, a doc-only note calling out the option would
    cover the same ground.

Happy to open a PR with this exact change if you'd like — it's two lines.

Activity

  1. added a commit that references this issue on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions