Skip to content

Commit message generation fails with “Request too large” error for large commits #2427

@DefinitelyADev

Description

@DefinitelyADev

Description

When attempting to generate a commit message for a large commit, Fork fails with the following error:

OpenAI error: Request too large for gpt-4o in organization org-XXXXX on tokens per min (TPM):
Limit 30000, Requested 206842. The input or output tokens must be reduced in order to run successfully.
Visit https://platform.openai.com/account/rate-limits to learn more.

This prevents commit message generation entirely for commits with large diffs.

Image

Steps to Reproduce

  1. Stage a large number of files (e.g. lockfiles, snapshots, generated files, etc.)
  2. Use AI → Generate Commit Message
  3. Observe error dialog.

Expected Behavior

  • Fork should be able to handle large diffs gracefully.
  • Possible strategies:
    • Summarize only file paths (not full diffs).
    • Automatically ignore large/noisy files (e.g. package-lock.json, *.snap, *.min.js, etc.).
    • Option to choose which files/diffs to include in AI prompt.
    • Allow switching to a higher-throughput model (e.g. gpt-4o-mini) for commit messages.

Actual Behavior

  • Fork sends the full diff to the model, exceeding OpenAI’s 30k TPM limit (my request hit ~206k).
  • Error dialog appears and no commit message is generated.

Environment

  • Fork version: 2.55.3
  • OS: macOS 15.6 (24G84)
  • OpenAI model: gpt-4o
  • Organization TPM limit: 30000

Possible Solutions

  • Add configurable max token budget per request.
  • Add diff summarization (e.g. git diff --stat instead of full git diff).
  • Provide a model selection option in Fork settings.
  • Auto-ignore common large files from AI prompts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions