CommandCodeAI / CommandCodeAI/command-code

Error: 400 Input length ____ exceeds the maximum allowed input length of ____ tokens

Open
#652 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
4k
Forks
350
PR merge metrics
No merged PRs in 30d

Description

Summary

When using the ~recently released "Laguna-s-2.1" model, which appears to do a considerable amount of 'thinking', I have regularly encountered the message "Error: 400 Input length ____ exceeds the maximum allowed input length of ____ tokens" (in many cases, with a very small minority :: <~100/100000'th overflow) after interacting with a project's code for awhile. Shortly thereafter, it will refuse to compact (yet still emit too large an input, thus rendering the 'task' effectively unable to complete). The first few such can usually be overcome by a manual /compact (which seems to compact more than the 'auto-compact' sort), followed by 'continue'. After which command, it fails to 'continue' even when 'compact' is claimed to have 'saved' hundreds of thousands of tokens. At which point I have to switch to DeepSeek-V4-Flash-0731 or similar to ~complete. Commands such as "/usage" do not appear to show useful information about the issue.

Expected Behavior

It would seem to me that if context is indeed irretrievably ~overstuffed, then that should be reflected by the /compact command

Actual Behavior

manual /compact claims to recover many tokens, yet overflow errors continue

Steps to reproduce the issue

As shown in report overview

Command Code Version

1.14.1

Operating System

macOS

Terminal/IDE

OSX 'Terminal' w / cmd

Shell

zsh

Session file (optional)

No response

Fix prompt (optional)

No response

Additional context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the overflow in Command Code 1.14.1 on macOS Terminal with zsh, using the Laguna-s-2.1 model after extended interaction. Compare the behavior and reported token counts of manual /compact, auto-compact, /usage, and continue; done means compaction accurately reflects the remaining context and prevents repeated input-length failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
zsh
Domain
ai, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.