Skip to content

fix(desktop): export tail of oversized logs in debug bundle - #47672

Merged
Hona merged 1 commit into
anomalyco:v2from
Hona:debug-export-log
Sep 6, 2026
Merged

fix(desktop): export tail of oversized logs in debug bundle#47672
Hona merged 1 commit into
anomalyco:v2from
Hona:debug-export-log

Conversation

@Hona

@Hona Hona commented Sep 6, 2026

Copy link
Copy Markdown
Member

The debug bundle silently dropped the one file that matters.

  • collect skipped any file over 50 MB. The V2 server appends to opencode.log with no rotation, so on a long-lived install the active server log is the largest file in the directory and gets excluded.
  • The bundle then only contained a stale opencode-local.log from a different (idle) server, making the export useless for diagnosing the current session.
  • Oversized files now contribute their last 50 MB instead of being skipped. manifest.json lists them under truncated so the reader knows the head is missing.
flowchart LR
  A[stat file] --> B{size > 50 MB?}
  B -- no --> C[readFile]
  B -- yes --> D["stream(path, { offset: size - 50 MB })"]
  C --> E[zip entry]
  D --> E
  D --> F["manifest.truncated[]"]
Loading
// packages/desktop/src/main/native/logging.ts
const offset = Math.max(0, Number(info.size) - MAX_EXPORT_FILE_SIZE)
return { name, path: file, offset }

// writeZip
entry.offset === 0
  ? yield* fs.readFile(entry.path)
  : Buffer.concat(yield* Stream.runCollect(fs.stream(entry.path, { offset: entry.offset })))

@Hona
Hona requested a review from Brendonovich as a code owner September 6, 2026 21:46
Copilot AI lite review requested due to automatic review settings September 6, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hona
Hona merged commit 0d70595 into anomalyco:v2 Sep 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants