Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
fix(open-knowledge): carry renderer crash evidence into bug reports (PRD-7635) (#2987)
Andrew Mikofalvy11bee49c1252
diff --git a/.changeset/bug-report-renderer-telemetry.md b/.changeset/bug-report-renderer-telemetry.mdnew file mode 100644index 000000000..138467351--- /dev/null+++ b/.changeset/bug-report-renderer-telemetry.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++Bug reports sent from the desktop app now carry the evidence needed to diagnose an editor crash. Two pieces were missing. First, the detailed-diagnostics report is meant to be a superset of the basic one, but it was leaving out the app's own log file — the one the desktop app writes the editor's console messages into. Basic reports included it, detailed ones did not, so the most thorough report was the one that dropped the crash trail. Second, when the editor hit an error, the report recorded the error message but not React's component stack, which is the only part of a crash that still names real parts of the app in a released build; without it, a crash report read as a string of meaningless letters and numbers. Reports now include both, so a crash can be traced without asking you to copy anything out of a developer console by hand. Secrets in the newly included log are redacted the same way as everywhere else, and the component stack is trimmed to its most relevant frames.diff --git a/packages/app/src/components/AppErrorBoundary.dom.test.tsx b/packages/app/src/components/AppErrorBoundary.dom.test.tsxindex e27df6f6b..ac2f0ef19 100644--- a/packages/app/src/components/AppErrorBoundary.dom.test.tsx+++ b/packages/app/src/components/AppErrorBoundary.dom.test.tsx@@ -188,12 +188,17 @@ describe('AppErrorBoundary', () => {await user.click(screen.getByRole('button', { name: 'Create report' }));await screen.findByRole('heading', { name: 'Review your report' });- expect(createCalls).toEqual([- {- level: 'full',- note: 'Crash source: app shell\nError: MaybeThrow boom: shell',- },- ]);+ expect(createCalls).toHaveLength(1);+ expect(createCalls[0]?.level).toBe('full');+ const note = createCalls[0]?.note ?? '';+ expect(note).toContain('Crash source: app shell');+ expect(note).toContain('Error: MaybeThrow boom: shell');+ // React's component stack rides along: in a packaged build it is the only+ // part of a crash that still names a real component.+ expect(note).toContain('Component stack:');+ expect(note).toContain('at MaybeThrow');+ // Frame directories are trimmed, so the note cannot carry a home path.+ expect(note).not.toContain('/Users/');});test('does not intercept errors the per-document boundary already handles', () => {diff --git a/packages/app/src/components/AppErrorBoundary.tsx b/packages/app/src/components/AppErrorBoundary.tsxindex 96f0db365..bfd0a3781 100644--- a/packages/app/src/components/AppErrorBoundary.tsx+++ b/packages/app/src/components/AppErrorBoundary.tsx@@ -19,6 +19,7 @@ import { ErrorBoundary, type FallbackProps } from 'react-error-boundary';import { OkBlob } from '@/components/OkBlob';import { ReportBugDialog } from '@/components/ReportBugDialog';import { Button } from '@/components/ui/button';+import { recallComponentStack, rememberComponentStack } from '@/lib/component-stack-registry';function AppErrorFallback({ error, resetErrorBoundary }: FallbackProps) {const { t } = useLingui();@@ -74,6 +75,7 @@ function AppErrorFallback({ error, resetErrorBoundary }: FallbackProps) {crashContext={{source: 'app shell',errorMessage: error instanceof Error && error.message ? error.message : String(error),+ componentStack: recallComponentStack(error),}}/></CrashReportingBoundary>@@ -86,10 +88,15 @@ export function AppErrorBoundary({ children }: { children: React.ReactNode }) {return (<ErrorBoundaryFallbackComponent={AppErrorFallback}- onError={(error) => {- // Full error object so the stack reaches the console — and, via the- // renderer console capture, the next diagnostic bundle.- console.error('[AppErrorBoundary] app-shell render crash', error);+ onError={(error, info) => {+ rememberComponentStack(error, info.componentStack);+ // The component stack is logged alongside the error because a packaged+ // build's minified message + mangled JS stack name nothing on their own.+ console.error(+ '[AppErrorBoundary] app-shell render crash',+ error,+ info.componentStack ?? '',+ );}}>{children}diff --git a/packages/app/src/components/DocumentErrorBoundary.dom.test.tsx b/packages/app/src/components/DocumentErrorBoundary.dom.test.tsxindex f9493607f..0b07789f2 100644--- a/packages/app/src/components/DocumentErrorBoundary.dom.test.tsx+++ b/packages/app/src/components/DocumentErrorBoundary.dom.test.tsx@@ -258,12 +258,16 @@ describe('DocumentErrorBoundary (Tier-3 mount)', () => {await user.click(screen.getByRole('button', { name: 'Create report' }));await screen.findByRole('heading', { name: 'Review your report' });- expect(createCalls).toEqual([- {- level: 'full',- note: 'Crash source: document view\nDocument: alpha.md\nError: MaybeThrow boom: alpha',- },- ]);+ expect(createCalls).toHaveLength(1);+ expect(createCalls[0]?.level).toBe('full');+ const note = createCalls[0]?.note ?? '';+ expect(note).toContain('Crash source: document view');+ expect(note).toContain('Document: alpha.md');+ expect(note).toContain('Error: MaybeThrow boom: alpha');+ expect(note).toContain('Component stack:');+ expect(note).toContain('at MaybeThrow');+ // Frame directories are trimmed, so the note cannot carry a home path.+ expect(note).not.toContain('/Users/');});test('the report action is absent without the desktop bridge', () => {diff --git a/packages/app/src/components/DocumentErrorBoundary.tsx b/packages/app/src/components/DocumentErrorBoundary.tsxindex e0cc0fe97..d8b214ebe 100644--- a/packages/app/src/components/DocumentErrorBoundary.tsx+++ b/packages/app/src/components/DocumentErrorBoundary.tsx@@ -50,6 +50,7 @@ import {ServerCapabilityMismatchError,SyncTimeoutError,} from '@/editor/sync-promise';+import { recallComponentStack, rememberComponentStack } from '@/lib/component-stack-registry';import { restartCollabServer } from '@/lib/restart-collab-server';interface ErrorCopy {@@ -287,6 +288,7 @@ function DocumentErrorFallback({// reason as back-nav: activeDocName can lag the errored target.docName: errorDocName(error) ?? activeDocName,errorMessage: error instanceof Error && error.message ? error.message : String(error),+ componentStack: recallComponentStack(error),}}/>) : null}@@ -374,15 +376,18 @@ export function DocumentErrorBoundary({);}}}- onError={(error) => {+ onError={(error, info) => {+ rememberComponentStack(error, info.componentStack);// Pass the full error object as the second arg so the stack trace and// cause chain reach the console — `errorCopy(error).title` alone is a// user-facing summary ("Couldn't open document") with no debugging// signal. console.error (not warn) so it surfaces at the right severity- // for the user-visible fallback that just rendered.+ // for the user-visible fallback that just rendered. The component stack+ // is the only frame-level signal that survives a packaged build.console.error(`[DocumentErrorBoundary] rendered fallback for ${activeDocName}: ${errorCopy(error).title}`,error,+ info.componentStack ?? '',);}}>diff --git a/packages/app/src/components/ReportBugDialog.dom.test.tsx b/packages/app/src/components/ReportBugDialog.dom.test.tsxindex 67e599246..99f670f94 100644--- a/packages/app/src/components/ReportBugDialog.dom.test.tsx+++ b/packages/app/src/components/ReportBugDialog.dom.test.tsx@@ -505,6 +505,46 @@ describe('ReportBugDialog', () => {);});+ test("a crash context folds React's component stack into the note, capped", async () => {+ const log = installBridge();+ // 27 frames: two past the 25 kept, so the omission line is exercised.+ // Fully-qualified locations, as React emits them.+ const frames = Array.from(+ { length: 27 },+ (_, i) => ` at Component${i} (/Users/someone/OpenKnowledge.app/bundle.js:1:${i})`,+ );+ await renderDialog({+ crashContext: {+ source: 'app shell',+ errorMessage: 'Minified React error #185',+ componentStack: `\n${frames.join('\n')}\n`,+ },+ });++ await createReport('it crashed');++ const note = log.createCalls[0]?.note ?? '';+ expect(note).toContain('Component stack:');+ // Directory trimmed to the basename: keeps the source map coordinates,+ // drops the home path the bundle was loaded from.+ expect(note).toContain('at Component0 (bundle.js:1:0)');+ expect(note).toContain('at Component24 (bundle.js:1:24)');+ expect(note).not.toContain('/Users/');+ expect(note).not.toContain('at Component25');+ expect(note).toContain('... 2 more frame(s) omitted');+ });++ test('a crash context without a component stack keeps the note unchanged', async () => {+ const log = installBridge();+ await renderDialog({+ crashContext: { source: 'app shell', errorMessage: 'boom' },+ });++ await createReport('it crashed');++ expect(log.createCalls[0]?.note).toBe('it crashed\n\nCrash source: app shell\nError: boom');+ });+test('a failed create surfaces the error with the CLI fallback and stays in compose', async () => {installBridge({create: () => Promise.resolve({ ok: false, error: 'zip destination not writable' }),diff --git a/packages/app/src/components/ReportBugDialogBody.tsx b/packages/app/src/components/ReportBugDialogBody.tsxindex b2ac71caf..2a0ad14e6 100644--- a/packages/app/src/components/ReportBugDialogBody.tsx+++ b/packages/app/src/components/ReportBugDialogBody.tsx@@ -85,6 +85,13 @@ export interface ReportBugCrashContext {/** Document that was active when the error surfaced, when known. */docName?: string;errorMessage?: string;+ /**+ * React's component stack for the throw, from the error boundary's+ * `errorInfo`. Production bundles minify both the error message (React ships+ * numeric codes) and the JS stack (mangled identifiers), so this is the only+ * frame-level signal in a packaged crash report that names real components.+ */+ componentStack?: string;}interface CreatedReport {@@ -105,10 +112,50 @@ function composeNote(userNote: string, contextLines: string[] | undefined): strireturn trimmed === '' ? context : `${trimmed}\n\n${context}`;}+/**+ * Frames kept from the component stack. Deep trees can produce hundreds; the+ * innermost few identify the throw site, and the note is user-reviewed in the+ * compose box before sending, so an unbounded dump would swamp it.+ */+const COMPONENT_STACK_FRAME_LIMIT = 25;++/**+ * Reduce a frame's source location to `basename:line:col`.+ *+ * React emits fully-qualified locations, so an untrimmed frame carries the+ * absolute path the bundle was loaded from — which on a per-user install is+ * under the home directory. The directory is worthless for triage anyway: the+ * component name plus `file:line:col` is what maps back through a source map.+ */+function trimFrameLocation(frame: string): string {+ return frame.replace(/\(([^)]*)\)/, (whole, location: string) => {+ const leaf = location.split(/[/\\]/).pop();+ return leaf === undefined || leaf === '' ? whole : `(${leaf})`;+ });+}++function componentStackLines(componentStack: string): string[] {+ const frames = componentStack+ .split('\n')+ .map((line) => trimFrameLocation(line.trim()))+ .filter((line) => line !== '');+ if (frames.length === 0) return [];+ const kept = frames.slice(0, COMPONENT_STACK_FRAME_LIMIT);+ const omitted = frames.length - kept.length;+ return [+ 'Component stack:',+ ...kept,+ ...(omitted > 0 ? [`... ${omitted} more frame(s) omitted`] : []),+ ];+}+function crashContextLines(crashContext: ReportBugCrashContext): string[] {const lines = [`Crash source: ${crashContext.source}`];if (crashContext.docName !== undefined) lines.push(`Document: ${crashContext.docName}`);if (crashContext.errorMessage !== undefined) lines.push(`Error: ${crashContext.errorMessage}`);+ if (crashContext.componentStack !== undefined) {+ lines.push(...componentStackLines(crashContext.componentStack));+ }return lines;}diff --git a/packages/app/src/lib/component-stack-registry.test.ts b/packages/app/src/lib/component-stack-registry.test.tsnew file mode 100644index 000000000..1945f147c--- /dev/null+++ b/packages/app/src/lib/component-stack-registry.test.ts@@ -0,0 +1,48 @@+import { describe, expect, test } from 'vitest';+import { recallComponentStack, rememberComponentStack } from './component-stack-registry';++describe('component-stack-registry', () => {+ test('round-trips a stack for the error it was recorded against', () => {+ const error = new Error('boom');+ rememberComponentStack(error, '\n at Editor (bundle.js:1:1)\n');++ expect(recallComponentStack(error)).toBe('\n at Editor (bundle.js:1:1)\n');+ });++ test('keys on the thrown value so a nested boundary cannot leak into an outer one', () => {+ const inner = new Error('inner');+ const outer = new Error('outer');+ rememberComponentStack(inner, ' at DocumentBoundary');++ expect(recallComponentStack(outer)).toBeUndefined();+ });++ test('ignores primitives, which cannot key the registry', () => {+ rememberComponentStack('a thrown string', ' at Editor');++ expect(recallComponentStack('a thrown string')).toBeUndefined();+ expect(recallComponentStack(null)).toBeUndefined();+ expect(recallComponentStack(undefined)).toBeUndefined();+ });++ test('ignores absent and blank stacks so the report omits the section entirely', () => {+ const missing = new Error('missing');+ const blank = new Error('blank');+ const nulled = new Error('nulled');+ rememberComponentStack(missing, undefined);+ rememberComponentStack(blank, ' \n ');+ rememberComponentStack(nulled, null);++ expect(recallComponentStack(missing)).toBeUndefined();+ expect(recallComponentStack(blank)).toBeUndefined();+ expect(recallComponentStack(nulled)).toBeUndefined();+ });++ test('a later record for the same error wins', () => {+ const error = new Error('boom');+ rememberComponentStack(error, ' at First');+ rememberComponentStack(error, ' at Second');++ expect(recallComponentStack(error)).toBe(' at Second');+ });+});diff --git a/packages/app/src/lib/component-stack-registry.ts b/packages/app/src/lib/component-stack-registry.tsnew file mode 100644index 000000000..dafaaf8d0--- /dev/null+++ b/packages/app/src/lib/component-stack-registry.ts@@ -0,0 +1,31 @@+/**+ * Carries React's `errorInfo.componentStack` from an error boundary's+ * `onError` to the fallback that renders next.+ *+ * `react-error-boundary` passes `errorInfo` to `onError` only — `FallbackProps`+ * is `{ error, resetErrorBoundary }` — so a fallback building a crash report+ * cannot otherwise reach it. That matters because a packaged build minifies+ * both halves of the usual signal: React ships numeric error codes instead of+ * messages, and the JS stack is mangled identifiers. The component stack is the+ * only part that still names real components.+ *+ * Keyed by the thrown value rather than a module-level "last stack" so a nested+ * boundary that catches first cannot leak its stack into an outer boundary's+ * report. `WeakMap` also means a retained stack never outlives its error.+ */+const componentStacks = new WeakMap<object, string>();++/** No-ops for primitives (unkeyable) and for blank stacks (nothing to report). */+export function rememberComponentStack(+ error: unknown,+ componentStack: string | null | undefined,+): void {+ if (typeof error !== 'object' || error === null) return;+ if (typeof componentStack !== 'string' || componentStack.trim() === '') return;+ componentStacks.set(error, componentStack);+}++export function recallComponentStack(error: unknown): string | undefined {+ if (typeof error !== 'object' || error === null) return undefined;+ return componentStacks.get(error);+}diff --git a/packages/cli/src/commands/bug-report-bundle.ts b/packages/cli/src/commands/bug-report-bundle.tsindex 59dea80bb..bd208d17f 100644--- a/packages/cli/src/commands/bug-report-bundle.ts+++ b/packages/cli/src/commands/bug-report-bundle.ts@@ -168,6 +168,20 @@ function collectSysinfo(): Record<string, unknown> {return info;}+/**+ * User-level log files (`~/.ok/logs/*.log`), optionally narrowed to one+ * project. Shared with the full bundle so both report levels harvest the same+ * set — on desktop these carry the renderer console, which reaches no other+ * sink.+ *+ * The slug filter is best-effort: when no file matches it, every file is+ * returned rather than none, because a log that predates project tagging is+ * still better evidence than an empty bundle.+ */+export function collectUserLogFiles(projectSlug: string | null, logsDir: string): string[] {+ return collectLogs(projectSlug, logsDir).files;+}+function collectLogs(projectSlug: string | null, logsDir: string): { files: string[] } {if (!existsSync(logsDir)) return { files: [] };diff --git a/packages/cli/src/diagnose/bundle-redact.ts b/packages/cli/src/diagnose/bundle-redact.tsindex d5ebf0003..184a456d3 100644--- a/packages/cli/src/diagnose/bundle-redact.ts+++ b/packages/cli/src/diagnose/bundle-redact.ts@@ -272,6 +272,23 @@ function walkDirFiles(dir: string): string[] {// the contentDir). Other state files get substring-only substitution.const STATE_JSON_FILES = new Set(['agent-presence.json', 'agent-effects.json', 'runtime.json']);+/**+ * Rotated log files carry their counter where the extension would be+ * (`desktop.2026-07-28.log.3`), so any suffix test has to special-case them.+ */+export function isRotatedLogPath(filePath: string): boolean {+ return /\.log\.\d+$/.test(filePath);+}++/**+ * The user-level logs are pino JSONL that happen to carry a `.log` suffix, so+ * routing them by extension alone would give them the substring-only pass and+ * silently drop the doc-name hashing the full level's `--redact` promises.+ */+function isLineDelimitedJson(filePath: string): boolean {+ return filePath.endsWith('.jsonl') || filePath.endsWith('.log') || isRotatedLogPath(filePath);+}+export function redactStagedBundle(opts: RedactStagedBundleOpts): RedactStagedBundleResult {const ctx: RedactCtx = {contentDir: opts.contentDir,@@ -282,7 +299,7 @@ export function redactStagedBundle(opts: RedactStagedBundleOpts): RedactStagedBufor (const subdir of ['telemetry', 'logs', 'process']) {for (const filePath of walkDirFiles(join(opts.stagingDir, subdir))) {- if (filePath.endsWith('.jsonl')) {+ if (isLineDelimitedJson(filePath)) {redactJsonlFile(filePath, ctx);} else if (filePath.endsWith('.json')) {redactJsonFile(filePath, ctx);diff --git a/packages/cli/src/diagnose/bundle.ts b/packages/cli/src/diagnose/bundle.tsindex b59231d87..bac65421a 100644--- a/packages/cli/src/diagnose/bundle.ts+++ b/packages/cli/src/diagnose/bundle.ts@@ -41,7 +41,11 @@ import { ZipFile } from 'yazl';import type { BundleExtraFile, BundleLogger } from '../commands/bug-report-bundle.ts';import { redactContent } from '../commands/bug-report-redact.ts';import { PACKAGE_VERSION } from '../constants.ts';-import { type RedactStagedBundleResult, redactStagedBundle } from './bundle-redact.ts';+import {+ isRotatedLogPath,+ type RedactStagedBundleResult,+ redactStagedBundle,+} from './bundle-redact.ts';// ---------------------------------------------------------------------------// Manifest schema@@ -191,6 +195,20 @@ export interface CollectBundleOpts {* text-scrubbed.*/extraFiles?: BundleExtraFile[];+ /**+ * Absolute paths to user-level log files (`~/.ok/logs/*.log`) staged under+ * `logs/` beside the project's server sink logs, at the same bundle paths the+ * standard level uses.+ *+ * Load-bearing for desktop crash reports: the Electron main process captures+ * the renderer console into the user-level log, not the project's server log+ * (`installClientLogForwarder` short-circuits when `window.okDesktop` is+ * present), so without these a full bundle carries no renderer signal at all.+ *+ * Staged BEFORE the redaction + secret scrub — unlike `extraFiles`, these are+ * text and must be scrubbed.+ */+ userLogFiles?: string[];/** Test-injectable dependencies — every field defaults to a real-system implementation. */deps?: CollectBundleDeps;}@@ -630,6 +648,10 @@ function shouldCountLines(relPath: string): boolean {const SECRET_SCRUB_EXTENSIONS = new Set(['.jsonl', '.json', '.txt', '.log', '.lock']);function isSecretScrubbable(relPath: string): boolean {+ // A rotated log's real extension is its counter (`.log.3` slices to `.3`), so+ // an extension-set test alone silently skips it — and the user-level logs the+ // full bundle now carries are exactly the ones that rotate.+ if (isRotatedLogPath(relPath)) return true;const lastDot = relPath.lastIndexOf('.');if (lastDot === -1) return false;return SECRET_SCRUB_EXTENSIONS.has(relPath.slice(lastDot));@@ -692,6 +714,9 @@ export async function collectBundle(opts: CollectBundleOpts): Promise<CollectedB);stageFileIfPresent(logsCurrentPath(projectDir), join(stagingDir, 'logs', LOGS_CURRENT));stageFileIfPresent(logsPreviousPath(projectDir), join(stagingDir, 'logs', LOGS_PREVIOUS));+ for (const userLogPath of opts.userLogFiles ?? []) {+ stageFileIfPresent(userLogPath, join(stagingDir, 'logs', basename(userLogPath)));+ }// Server lock + status + agent presence.const lockDir = join(projectDir, '.ok', 'local');diff --git a/packages/cli/src/report-bundle.test.ts b/packages/cli/src/report-bundle.test.tsindex 7727295be..5045b58a9 100644--- a/packages/cli/src/report-bundle.test.ts+++ b/packages/cli/src/report-bundle.test.ts@@ -204,6 +204,80 @@ describe('collectReportBundle — full level', () => {expect(summary.files).toEqual(paths);});+ test('carries the user-level logs the standard level collects, scrubbed', async () => {+ // On desktop the Electron main process captures the renderer console into+ // the user-level log, never into the project's server sink — so this is the+ // only path a renderer crash reaches a full bundle by.+ const projectDir = makeFullProjectDir();+ const userLogsDir = makeTmpDir();+ writeAt(+ userLogsDir,+ 'desktop.2026-07-28.log',+ `${JSON.stringify({ subsystem: 'renderer', msg: 'app-shell render crash' })}\n${JSON.stringify({ msg: `token ${SECRET}` })}\n`,+ );+ const outputPath = join(makeTmpDir(), 'report.zip');++ const { zipPath, summary } = await collectReportBundle({+ level: 'full',+ projectDir,+ redact: true,+ outputPath,+ userLogsDir,+ });++ const entries = listZipEntries(zipPath);+ expect(entries).toContain('logs/desktop.2026-07-28.log');+ expect(summary.files).toContain('logs/desktop.2026-07-28.log');+ const body = readZipEntry(zipPath, 'logs/desktop.2026-07-28.log');+ expect(body).toContain('app-shell render crash');+ // Staged before the scrub, unlike extra/ payloads.+ expect(body).not.toContain(SECRET);+ });++ test('scrubs ROTATED user logs too, whose counter suffix defeats an extension test', async () => {+ const projectDir = makeFullProjectDir();+ const userLogsDir = makeTmpDir();+ // `desktop.2026-07-28.log.1` slices to `.1`, not `.log`.+ writeAt(+ userLogsDir,+ 'desktop.2026-07-28.log.1',+ `${JSON.stringify({ msg: `token ${SECRET}` })}\n`,+ );+ const outputPath = join(makeTmpDir(), 'report.zip');++ const { zipPath } = await collectReportBundle({+ level: 'full',+ projectDir,+ redact: true,+ outputPath,+ userLogsDir,+ });++ expect(listZipEntries(zipPath)).toContain('logs/desktop.2026-07-28.log.1');+ expect(readZipEntry(zipPath, 'logs/desktop.2026-07-28.log.1')).not.toContain(SECRET);+ });++ test('hashes doc names in user logs, which are pino JSONL behind a .log suffix', async () => {+ const projectDir = makeFullProjectDir();+ const userLogsDir = makeTmpDir();+ writeAt(+ userLogsDir,+ 'desktop.2026-07-28.log',+ `${JSON.stringify({ attributes: [{ key: 'doc.name', value: { stringValue: 'secret-notes/plan' } }] })}\n`,+ );+ const outputPath = join(makeTmpDir(), 'report.zip');++ const { zipPath } = await collectReportBundle({+ level: 'full',+ projectDir,+ redact: true,+ outputPath,+ userLogsDir,+ });++ expect(readZipEntry(zipPath, 'logs/desktop.2026-07-28.log')).not.toContain('secret-notes/plan');+ });+test('omits telemetry entirely when the sink has never written', async () => {const projectDir = makeTmpDir();writeAt(projectDir, '.ok/config.yml', 'name: bare-proj\n');diff --git a/packages/cli/src/report-bundle.ts b/packages/cli/src/report-bundle.tsindex 2eb97c2b2..13474477e 100644--- a/packages/cli/src/report-bundle.ts+++ b/packages/cli/src/report-bundle.ts@@ -6,6 +6,7 @@*/import { existsSync, mkdirSync, readFileSync } from 'node:fs';+import { homedir } from 'node:os';import { dirname, join, resolve } from 'node:path';import type {ReportBundleLevel as CoreReportBundleLevel,@@ -16,6 +17,7 @@ import {type BundleExtraFile,type BundleLogger,collectStandardBundle,+ collectUserLogFiles,resolveProjectSlug,} from './commands/bug-report-bundle.ts';import {@@ -107,6 +109,7 @@ async function collectFullBundle(projectDir: string,readDesktopEnv: () => DesktopMetadata | null,): Promise<ReportBundleResult> {+ const projectSlug = resolveProjectSlug(projectDir, opts.logger);const collected = await collectBundle({contentDir: resolveContentDir(projectDir, opts.logger),projectDir,@@ -114,6 +117,14 @@ async function collectFullBundle(scrubSecrets: opts.redact,note: opts.note,extraFiles: opts.extraFiles,+ // The full level is documented as a superset of standard, so it harvests+ // the same user-level logs. Omitting them silently dropped the renderer+ // console from every desktop crash report, since the Electron main process+ // captures it here rather than into the project's server sink.+ userLogFiles: collectUserLogFiles(+ projectSlug,+ opts.userLogsDir ?? join(homedir(), '.ok', 'logs'),+ ),deps: { readDesktopEnv, logger: opts.logger },});try {@@ -125,7 +136,7 @@ async function collectFullBundle(summary: {level: 'full',systemWide: false,- projectSlug: resolveProjectSlug(projectDir, opts.logger),+ projectSlug,files: collected.manifest.files.map((f) => f.path),redactions: scrub?.redactions ?? [],redactedLineCount: scrub?.redactedLineCount ?? 0,