Skip to content

Long content fails with "Prompt is too long"; manually saving it to a local file and asking the agent to read it fails identically #14

@BlessedChild

Description

@BlessedChild

When pasting a long block of text (e.g. a long document, log dump, or chat transcript) into the chat input and sending, the message fails with the error "Prompt is too long".

I tried a workaround: manually save the same content into a local file in the workspace and ask the agent to read it. This triggered the same "Prompt is too long" error — because the file content ultimately still gets injected into the prompt, so it is no different from pasting directly.

So this is really a context-window-overflow issue, not a paste / input-box issue. Currently Finch gives no actionable hint and no automatic fallback path.

Steps to reproduce

  1. Copy a long block of content (e.g. several thousand characters of prose or logs).
  2. Paste it into the Finch chat input and press send → fails with "Prompt is too long".
  3. Manually save that same content as a local file in the workspace (e.g. long-content.md).
  4. Ask the agent in Finch to read that file → same error: "Prompt is too long".

Expected behavior

When content (either directly pasted or pulled in via file read) would push the prompt past the model's context limit, Finch should at minimum:

  1. Show a clearer error: explicitly tell the user this is a "context window exceeded" condition, not a generic "send failed";
  2. Provide a fallback path, for example:
    • Chunked/streaming processing for long files, only injecting relevant chunks into the prompt;
    • Automatic summarization before injection;
    • Prompt the user to split the content / start a new conversation;
  3. Do not imply that "save it to a file" is a workaround — because reading the file hits the same ceiling.

Actual behavior

  • Sending long content directly → "Prompt is too long" error; the conversation does not progress.
  • Saving the content to a local file + asking the agent to read it → same "Prompt is too long" error.
  • No in-app fallback. The user has to manually split the content and send it across multiple turns.

Suggested fix

  • In the send / file-read pipeline, detect when the prompt is about to exceed the limit and surface a dedicated "context window exceeded" error with a message that names the actual cause;
  • Provide at least one automatic fallback: chunking, summarization, or an "I'll split this into N messages — proceed?" confirmation dialog.

Screenshots
Image

  • 03-long-paste-fail-1.png — "Prompt is too long" error when sending long content

Environment

  • App: Finch 1.3.0 (build 262) — Desktop
  • OS: macOS 26.4.1 (25E253)

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