Dashboard › opencode › Distillation
f45fd3c8-1631-4913-b027-a56639c96965["lore_tm_v1_NbZEJyUyyyigI0hyxb1s1PQ7eVHG94wRGVzS2eD3g6w","lore_tm_v1_D0xHLOwxL98-WwcZu9xacjhkjqF54t8EVGtBsYUrP8k","lore_tm_v1_TaoMd7mqgX2pLZLCFma2MAO2goFfv5CsKSk2ihnE5cM","lore_tm_v1_qnBYzo7je5anN5Cf58oMhrkO3KptWTcgCef60C43_wY","lore_tm_v1_QN50S2TUi95GqxgZz8JgyLS5gVYdLNYXdxsthK-_HQs","lore_tm_v1_Xdn1F3qsCh7bV3KDafcdetS9IirwWk98i_PtC-A3444","lore_tm_v1_qWXD5YRYfgIZ1j5eAcbqtojaqKnPp5hVGHevlqyij1M","lore_tm_v1_qgW4wtXRLrmogRXMLm-3wA42g-ok9-X9ezLQmCz1wns","lore_tm_v1_SGIbJ4b11sMMWADpGj4eriqCqSg0-ExAzhSI6WEdtHM"]
loadConfig() in /home/byk/Code/opencode-lore/packages/gateway/src/config.ts computes remoteGateway as remoteGatewayEnv || hostedModeEnv || autoDetected; LORE_REMOTE_GATEWAY=1 has highest priority, LORE_HOSTED_MODE=1 implies remote-gateway mode, and a non-loopback bind auto-detects remote mode only when neither environment variable is defined.LORE_REMOTE_GATEWAY=0 is an explicit disable that non-loopback bind auto-detection must not override; detection checks environment-variable presence with "LORE_REMOTE_GATEWAY" in env and "LORE_HOSTED_MODE" in env, not truthiness..lore.json loading, .lore.md import/export, and getGitRemote(); CLI --local / -l forces hosted mode off.loadConfig() defaults idleTimeoutSeconds from LORE_IDLE_TIMEOUT to 60, defaults sessionEvictionTimeoutSeconds from LORE_SESSION_EVICTION_TIMEOUT to 1800, and resolves Bedrock region as LORE_BEDROCK_REGION ?? AWS_REGION ?? AWS_DEFAULT_REGION ?? "us-east-1".vertexProject as LORE_VERTEX_PROJECT ?? GOOGLE_CLOUD_PROJECT ?? "" and vertexRegion as LORE_VERTEX_REGION ?? GOOGLE_CLOUD_REGION ?? GOOGLE_CLOUD_LOCATION ?? "global"./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/adapter.ts uses Effect.acquireRelease() around plugin.setup(context2): acquisition wraps Promise.resolve(plugin.setup(context2)), and release invokes a returned cleanup via Promise.resolve(cleanup()) or uses Effect.void when no cleanup exists.initIfNeeded() in /home/byk/Code/opencode-lore/packages/gateway/src/pipeline.ts calls enableHostedMode() before load(projectPath) and other filesystem operations when config.hostedMode is true, ensuring core functions touching client-controlled paths become safe no-ops first./home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts bounds embedding drain time with EMBED_DRAIN_DEADLINE_MS = Math.max(500, Math.floor(SHUTDOWN_DEADLINE_MS * 0.6)); unfinished embeds are re-indexed by runStartupBackfill on the next boot.VECTOR_POOL_SHUTDOWN_DEADLINE_MS = Math.max(Math.min(DEFAULT_VECTOR_POOL_SHUTDOWN_DEADLINE_MS, SHUTDOWN_DEADLINE_MS - 500), 500) so workersβ SQLite readers can close before the writer truncates the WAL while retaining at least 500 ms for aggressive shutdown settings such as LORE_SHUTDOWN_TIMEOUT_MS=1000.StartOptions.processBoundary is CLI-owned and is never set by in-process plugins.quiet: true and must pass local: true; quiet mode routes startup/shutdown notices through core log.warn() rather than terminal output, while local mode prevents process-wide hosted mode from breaking getGitRemote(), .lore.md import, configuration loading, and file watching.opts.local === true / --local always disables remote mode; /home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts sets both config.remoteGateway = false and config.remoteGatewayAutoDetected = false.lore start defaults hosted mode on and remote-gateway mode on when opts.local is undefined and no explicit LORE_HOSTED_MODE or LORE_REMOTE_GATEWAY is set; lore run, lore import, and in-process callers set opts.local = true.startGateway() validates assertGatewayAccessConfigured(config) only after CLI/environment/default mode precedence is fully applied, allowing --local to opt out before invariant validation.3207 β 5673 β 0 (OS-assigned random), while an explicitly configured port gets one attempt and fails on conflict./health does not establish Lore identity, and a reused handle has owned: false with a no-op shutdown.startServer() must be awaited inside the try because its bind-time EADDRINUSE rejection occurs at that await; after a conflict, startGatewayLocked() re-reads and authenticates the exact persisted owner before deciding whether to reuse it or continue the fallback chain./home/byk/Code/opencode-lore/packages/gateway/src/cli/start.ts: synchronously begin boundServer.stop(), call resetPipelineState({ fast: true }), await listener closure, stop and settle temporalEmbeddingQueue, settle document embeds, call embedding.resetProvider(), call shutdownVectorPoolAsync(VECTOR_POOL_SHUTDOWN_DEADLINE_MS), call closeDb(), then remove port/process discovery records.pid, token, and processIdentity, while a database-close failure emits a warning but does not wedge shutdown or retain an otherwise stale process record.0 always succeeds or throws a non-EADDRINUSE error, making the final throw new Error("Failed to bind to any port.") unreachable.