stability: warn when response body is truncated #11

Open
opened 2026-05-23 18:30:57 +00:00 by Klaus · 0 comments
Owner

Problem

pkg/gitea/rest.go caps error response bodies at ~8 KB before formatting them into the error message. When Gitea returns a helpful multi-KB error (e.g. validation errors on bulk operations), the useful part may be silently cut. Callers get a half-message with no signal that more was available.

Suggested direction

  • When truncation happens, append a clear marker like ... [truncated, original NNN bytes]
  • Log a Warn with the full byte count
  • Consider raising the cap to ~32 KB specifically for error bodies (responses are usually well under that)
## Problem `pkg/gitea/rest.go` caps error response bodies at ~8 KB before formatting them into the error message. When Gitea returns a helpful multi-KB error (e.g. validation errors on bulk operations), the useful part may be silently cut. Callers get a half-message with no signal that more was available. ## Suggested direction - When truncation happens, append a clear marker like `... [truncated, original NNN bytes]` - Log a `Warn` with the full byte count - Consider raising the cap to ~32 KB specifically for error bodies (responses are usually well under that)
Klaus referenced this issue from a commit 2026-05-23 18:47:28 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Klaus/gitea-mcp#11