Skip to content

[Bug] Auto-compact silently degrades to mechanical compaction when LLM fails #1518

Description

@akramcodez

Description

In source/utils/auto-compact.ts:270-276, if the LLMSummariser fails or aborts, the catch block simply falls through to the mechanical (regex-based) compaction: if (signal?.aborted) return null; // fall through to mechanical.

The success path for LLM compaction labels itself (LLM summary), but the degraded path has no distinct user-facing notice. Users on flaky connections or rate-limited APIs receive lower-quality summaries but have no visibility into the fact that the LLM call failed.

Environment

  • OS: All
  • Node version: v20+
  • Nanocoder version: Latest

Steps to Reproduce

  1. Turn on auto-compact with LLM strategy.
  2. Disconnect internet or force an API failure when a compaction triggers.
  3. Observe the compaction message.

Expected Behavior

The system should alert the user that the LLM failed and a mechanical fallback was used.

Actual Behavior

It falls back to mechanical compaction silently.

Additional Context

  • I have searched existing issues to ensure this is not a duplicate
  • I can reproduce this issue consistently
  • This issue occurs with the latest version of nanocoder

Implementation Notes

Add a (summary degraded: LLM call failed) marker to the compaction message when the catch block is triggered.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:agentAgent loop: context, compaction, subagents, memory, sessionsbugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions