Stu Mason
Stu Mason

Activity

Pull Request Merged

PR #83 merged: fix: deployment logs truncation by character count

Problem

When fetching deployment logs with lines: 50, the API returns 917K+ characters because:

  1. Coolify API doesn't support lines param - we fetch full log and truncate client-side
  2. Our truncation only limited line COUNT, not CHARACTER count
  3. Docker build logs have giant lines (base64 encoded data, minified code)

Solution

Add character-based truncation as a safety net:

BehaviorBeforeAfter
Default linesUnlimitedLast 200
Character limitNone50K (configurable)
Truncation indicatorNone...[truncated]... prefix

Changes

  • Default to last 200 lines when lines not specified
  • Cap at 50K characters regardless of line count
  • Add max_chars parameter for customization
  • Prepend ...[truncated]... when character limit applied

Test Plan

  • npm test - All 191 tests pass
  • npm run build - TypeScript compiles
  • Manual: deployment(action: "get", uuid: "...") should return < 100K chars

Closes #82

Stu Mason + AI [email protected]

+111
additions
-11
deletions
3
files changed