Stu Mason
Stu Mason

Activity

Pull Request Merged

PR #128 merged: fix: deployment logs truncation and pagination

Summary

Fixes #115 — lines param on deployment logs was doing nothing because Coolify returns logs as a JSON array in a single line (no newlines to split on). The full 96KB+ blob was returned regardless of the lines value.

  • Parse JSON array format — Coolify deployment logs are [{output, timestamp, hidden, ...}, ...] serialized as a single string. Now parsed properly instead of naive newline splitting.
  • Filter hidden entries — Docker internals (docker stop, docker rm) are marked hidden: true by Coolify. These are now excluded, showing only meaningful build output.
  • Add page param — Pagination through log history. Page 1 = most recent, page 2 = older batch, etc. Consistent with existing page/per_page pattern on list endpoints.
  • Return logs_meta{ total_entries, showing: "27-31 of 31" } so the model knows there's more to fetch.
  • _pagination hintsnext/prev with exact tool call args, matching existing HATEOAS pattern.

Before/After

BeforeAfter (lines: 10)
Response size96,060 chars771 chars
FormatRaw JSON array stringReadable [timestamp] output lines
Hidden entriesIncludedFiltered out
PaginationNonepage param + _pagination hints

Test plan

  • 242 unit tests pass (6 new tests for JSON parsing, pagination, metadata)
  • Smoke tested against live Coolify instance — pagination works across 3 pages
  • Plain text log fallback still works (backwards compatible)
  • Char limit safety net still applies
+196
additions
-26
deletions
3
files changed