claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Error during compaction: Error: API Error: Request was aborted.

Open skerit opened this issue 8 months ago • 2 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
  • Claude CLI version: 1.0.3
  • Operating System: Endeavour Linux 6.14.7
  • Terminal: Wezterm

Bug Description

Whenever I do a manual compact I get the Error during compaction: Error: API Error: Request was aborted. error around the 45 second mark. Auto compacts are also affected, but I don't ever see the error. I just see that it has started auto-compacting, but then it stops after +/- 45 seconds, and a few seconds later it tries again.

Steps to Reproduce

  1. /compact
  2. That's it

Expected Behavior

It should compact without problem

Actual Behavior

It does not

Additional Context

I got the Claude Max Maximum Flexibility plan a few days ago. I have noticed that when I manually switch from the default model to the sonnet model (using /model), it does work. But I have to do this manually, of course. (I don't want to keep using sonnet all the time, when claude-code sometimes wants to use opus)

skerit avatar May 27 '25 12:05 skerit

I get the same error message on tool calls as well as compactions. All requests that cause it seem to have

"cache_control": {
  "type": "ephemeral"
}

in them:

{
  "type": "tool_use",
  "id": "toolu_01XVkuzqnmZqUkPUnxd5yAfM",
  "name": "mcp__sequential-thinking__sequentialthinking",
  "input": {
    "thought": "Perfect! Now I understand exactly what I need to do. I need to completely rewrite the GraphML generation to use the yFiles format that yEd expects. This means:\n\n1. Adding all the yFiles namespaces\n2. Using yfiles.type key definitions\n3. Creating proper `<y:ShapeNode>` structures for each node\n4. Embedding the JSON content in `<y:NodeLabel>` elements with proper HTML formatting\n5. Using `<y:PolyLineEdge>` for edges with `<y:EdgeLabel>` for edge labels\n\nThis will be a significant rewrite but should make the labels properly visible in yEd.",
    "nextThoughtNeeded": false,
    "thoughtNumber": 3,
    "totalThoughts": 3
  },
  "cache_control": {
    "type": "ephemeral"
  }
}
{
  "type": "tool_use",
  "id": "toolu_01EoaoKabqesJCArmg8Um3qi",
  "name": "NotebookRead",
  "input": {
    "notebook_path": "/home/user/notebooks/prototype.ipynb"
  },
  "cache_control": {
    "type": "ephemeral"
  }
}

cpsquonk avatar Jun 14 '25 01:06 cpsquonk

● Update(tests/auth_manager.py)
  ⎿  Updated tests/auth_manager.py with 4 removals
       263       print(str(e))
       264       print(f"{'='*60}")
       265       hardcore_auth = None
       266 -      
       267 -      @property
       268 -      def has_real_auth(self) -> bool:
       269 -          """Check if real authentication is available."""
       266           return (
       267               not self.config.mock_mode and
       268               self.config.anthropic_key and
  ⎿  API Error: Request was aborted.

cpsquonk avatar Jun 16 '25 14:06 cpsquonk

The switch to /model sonnet is not working for me as a workaround for this issue. I get the Error: Error during compaction: Error: API Error: Request was aborted. even when I switch from opus to sonnet and the session is short.

palimondo avatar Jul 06 '25 23:07 palimondo