Dashboard › opencode-lore › Distillation
6d9721be-065f-42fe-aca1-42f93ae34656["lore_tm_v1_KQgDnT4qP37_vmkUuErTPWzmXihVQAu-0EZw6F88PJ4","lore_tm_v1_ImWNN4lRi6f89ApFGiDo-cDw1kNVXDJU3l6AseMlvkY","lore_tm_v1_aySay_4ZNyHfN4W7rZxpj4VnIw6qGzBBy_u_bR5QVRE","lore_tm_v1_IwkUu1zPe7_QXRAZSL5YIQhCQFrgi-jHy4s722cKdyo","lore_tm_v1_Q2N9xSvuYEvPt-RYYYYEGREKyFHOEHxWHMCfL7n2TrA","lore_tm_v1_Gx2cppXk29K7OE6QEq2RumZt1iwlMVia1luTyHn38do"]
Date: Sep 16, 2026
error logs are “Always visible — these indicate real failures.”packages/core/src/log.ts:496-504 implements error(...args: unknown[]): formats and redacts the message with redactSensitiveLogText(formatArgs(args)), writes [lore] to stderr unless readStderrSilenced() is true, reports through sink?.error(msg), persists via writeToFile("error", msg), and sends the first supplied Error to sink?.captureException(sanitizedError(err)).packages/core/src/log.ts: info() and warn() stderr output is gated by LORE_DEBUG; notice() is not debug-gated, writes to the sink at warning severity because notices are actionable but not failures; error() uses error severity. All levels continue writing to the persistent log and registered LogSink when stderr is silenced.packages/core/src/log.ts fixes incorrect LORE_DEBUG truthiness: only "1" or case-insensitive "true" enable debug. The prior !!process.env.LORE_DEBUG behavior incorrectly enabled output for non-empty values such as LORE_DEBUG=0 and LORE_DEBUG=false, causing [lore] stderr lines that could corrupt full-screen TUIs such as the Pi agent.globalThis.__loreStderrSilenced; silenceStderr(silenced = true) is idempotent and shared across separately bundled copies of @loreai/core, while isStderrSilenced() exposes current state. globalThis was chosen over a module-level variable because the gateway’s Node/CJS dist/index.cjs bundles a distinct core instance; only the Bun bundle keeps core external via gateway script/bundle.ts.startGateway() in-process and enable silenceStderr(), preventing every logger level—including error and output under LORE_DEBUG=1—from writing bytes to the host-owned TUI. Standalone CLI processes do not enable this mode and retain stderr visibility; embedded logs remain available through lore logs, the persistent file, and the registered LogSink.redactSensitiveLogText() in packages/core/src/log.ts filters credential/header assignments, PEM private keys, Bearer/Basic credentials, sensitive header-like keys, OpenAI-style sk- keys, GitHub tokens matching gh[pousr]_, AWS access keys matching AKIA[A-Z0-9]{16}, and JWT-shaped values; replacement text is [Filtered]. safeArgs() redacts strings and error stack/message text before stderr, while sanitizedError() preserves the error name but redacts its message and stack before exception capture.packages/core/src/log.ts: LOG_MAX_BYTES = 5 * 1024 * 1024 (5 MB), ROTATION_CHECK_INTERVAL = 1000, LOG_DIRECTORY_MODE = 0o700, LOG_FILE_MODE = 0o600, and non-Windows file opening uses constants.O_NOFOLLOW. Rotation moves the active log to ${logPath}.1, removes the prior backup, and revalidates/tightens the rotated file.log.error/related failure-reporting matches across packages/gateway/src/stream/openai-responses.ts and packages/gateway/src/pipeline.ts; OpenAI Responses sites include provider-failure logging at openai-responses.ts:2223, passthrough onComplete failures at :2835, and stream-translation failures at :3540.packages/gateway/src/pipeline.ts:9621-9632 guards completion with completionAttempted, finalizes recall diagnostics as "completed" or "failed", invokes opts.onComplete(resp, successful), and logs "openai-responses recall-aware onComplete error:" if that callback throws.packages/gateway/src/pipeline.ts:9634-9684 races opts.onRecall(input) against the abort signal, rolls back late results, logs "late recall rollback failed:" if rollback throws, records result text and coverage, and reports exhausted continuation budgets through log.info("recall final continuation: budget exhausted reason=..."); aborted callback failures are intentionally unobserved because the request no longer consumes their result.