[PR #3174] [MERGED] Remove text attachment prompt truncation #5827

Closed
opened 2026-10-22 04:19:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3174
Author: @SpicyMarinara
Created: 7/3/2026
Status: ✅ Merged
Merged: 7/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/remove-text-attachment-read-cap


📝 Commits (1)

  • e51d01d Remove text attachment prompt truncation

📊 Changes

3 files changed (+22 additions, -6 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+1 -6)
📝 scripts/regressions/prompt.regression.ts (+20 -0)

📄 Description

Summary

  • Removes the 60,000-character pre-truncation for readable text attachments before prompt context fitting.
  • Lets large uploaded text files use the selected model/connection context window instead of Marinara slicing them first.
  • Adds a prompt regression and changelog note.

Why

A user report described an apparent ~15k token cap for the last user message after uploading a text file. That maps closely to the old 60,000-character attachment cap. This was not a max-output setting issue, and it happened before provider/model context fitting had a chance to decide what actually fits.

Normal lorebook entry content does not appear to have a 50k content cap in the lorebook schema; lorebook budget and activation rules are separate, and provider/model context still remains the real upper bound.

Validation

  • pnpm check
  • pnpm regression:prompt
  • git diff --check

Manual verification

  • Upload a readable text file larger than 60,000 characters and inspect/debug the generated prompt to confirm the attachment is no longer pre-truncated before context fitting.

Summary by CodeRabbit

  • Bug Fixes

    • Large readable text-file attachments are no longer cut off before being included in prompts, so uploaded text can use the model’s full available context.
    • Prompt content now preserves the complete attachment text instead of showing a truncation notice for these files.
  • Tests

    • Added regression coverage to ensure long text attachments remain intact when added to prompt content.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/3174 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/3/2026 **Status:** ✅ Merged **Merged:** 7/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/remove-text-attachment-read-cap` --- ### 📝 Commits (1) - [`e51d01d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e51d01df3d45ce130cdf53eee55ba3ba3bc6df94) Remove text attachment prompt truncation ### 📊 Changes **3 files changed** (+22 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+1 -6) 📝 `scripts/regressions/prompt.regression.ts` (+20 -0) </details> ### 📄 Description ## Summary - Removes the 60,000-character pre-truncation for readable text attachments before prompt context fitting. - Lets large uploaded text files use the selected model/connection context window instead of Marinara slicing them first. - Adds a prompt regression and changelog note. ## Why A user report described an apparent ~15k token cap for the last user message after uploading a text file. That maps closely to the old 60,000-character attachment cap. This was not a max-output setting issue, and it happened before provider/model context fitting had a chance to decide what actually fits. Normal lorebook entry content does not appear to have a 50k content cap in the lorebook schema; lorebook budget and activation rules are separate, and provider/model context still remains the real upper bound. ## Validation - pnpm check - pnpm regression:prompt - git diff --check ## Manual verification - Upload a readable text file larger than 60,000 characters and inspect/debug the generated prompt to confirm the attachment is no longer pre-truncated before context fitting. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Large readable text-file attachments are no longer cut off before being included in prompts, so uploaded text can use the model’s full available context. * Prompt content now preserves the complete attachment text instead of showing a truncation notice for these files. * **Tests** * Added regression coverage to ensure long text attachments remain intact when added to prompt content. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:19:54 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5827
No description provided.