Dashboard › opencode-lore › Distillation
655cdc05-9ea0-49ef-818d-9d544a668641["lore_tm_v1_t4lE-W5MrnRoqyriSl0OlYUwdnO6EYn_e1nzLB4xZss","lore_tm_v1_nI3h-JKn7lH6l3aWogFmtRxXbGMJTYRNmg9rkouauPY","lore_tm_v1_4Jx1vtL8yGlBEhnxIwD_YikKgkzRbZYfxCSgNsGvGxA","lore_tm_v1_bFWUT0dvqSfKCDLb6zPOqFS8KA2rIN8HVllMwuJDQGY","lore_tm_v1_Wq90feN6qwVY8ykYEFoXK4Hu4ILYT5K2k7gM8QF9OgU","lore_tm_v1_Kzzjl7NAbIs15kAc9XN6VafX3aY4acgMYjWM1DF81qc","lore_tm_v1_SjF9XqWTkp66v6_c7V3iSfWag71UiusE9ctBNP2fMOE","lore_tm_v1_V7OlkVuQEEQR1MruKhUXzLzEbOZmK_dFJ9cKD5-Ck-w","lore_tm_v1_lZsfb38LWDEAGmpTUQPBPF6EdHj53K89ob16LBxsiPs","lore_tm_v1_MPeJmO7l0YAuWBOutV6d9GS8JKz1z7mEaPpxWJh3Pw0","lore_tm_v1_uPeEk77Y2rWT80WgcSbQi6R2GEVR1EOtmrt-UGg10LY","lore_tm_v1_Erd5OK_NZKg3g7G7pQhp-Z3yls_xiofoeyYAMdNnz2g"]
Date: Sep 16, 2026
packages/core/test/setup.ts installs a baseline globalThis.fetch guard that intercepts only https://models.dev/api.json, returns canned HTTP 200 JSON, and delegates every other request to the captured real fetch. This prevents gateway startup/pre-warm calls from depending on models.dev or polluting fetch-mock assertions across test files.packages/core/test/setup.ts defines: Anthropic claude-opus-4-6 with cost { input: 5, output: 25, cache_read: 0.5 } and limits { context: 1_000_000, output: 128_000 }; claude-sonnet-4-20250514 with cost { input: 3, output: 15, cache_read: 0.3 } and limits { context: 1_000_000, output: 64_000 }; claude-haiku-4-5 with cost { input: 1, output: 5, cache_read: 0.1 } and limits { context: 200_000, output: 64_000 }; OpenAI gpt-5.4-mini with cost { input: 0.75, output: 4.5, cache_read: 0.19 } and limits { context: 400_000, output: 100_000 }.silenceStderr(false) must run after every test so silenced logging state βnever crosses a test boundary.βinvalidateProjectIdCache() must run after every test; a settled/alias pathβID mapping cached by one test must βnever be served to another test that reuses the same path.βpackages/core/test/setup.ts uses a single temporary database for the test run, resets stderr suppression and the per-connection project pathβID memo in afterEach(), then calls close() and recursively removes the temporary directory in afterAll().packages/gateway/test/openai-responses-recall-aware-stream.test.ts contains 6 Number.MAX_SAFE_INTEGER references at lines 5643, 5679, 5705, 5735, 5764, and 5799, covering maximum sequence/index and token-count edge cases.sequence_number references in packages/gateway/test/openai-responses-stream.test.ts, including values 1, 2, 3, 4, 10, 11, 12, 13, 14, 16, 17, 99, and terminalSequence.1h TTL because 5m causes avoidable churn; the distilled prefix always occupies transformed-array positions [0,1], durable knowledge deltas remain near the tail, and orphan removal never touches the prefix.buildAnthropicRequest and remains uncached; persisted ltmCacheText must equal ltmPinText across restart and re-pin; the pin is baseline-only metadata and is never sent upstream; ltm.forSession() must not bust system[2] when the selected entry set is unchanged except for byte-identical re-anchoring.resolveTrustedRemote must βALWAYS use the on-disk remote valueβ when disk has a git remote. A client-supplied x-lore-git-remote must never override on-disk truth; in local mode with no disk remote, the client remote must be dropped to prevent the git-remote magnet bug from selecting a stale remote./lore:curate parsing rule: whole-file JSON.parse() is incorrect because the output is JSONL; multiple records βalways fail and can hide errors or abort evals.β Parse non-empty lines independently, surface the first type:"error", ignore malformed auxiliary lines, and derive score validity from primary result/session artifacts.packages/core/test/setup.ts must use a temporary LORE_DB_PATH, and an unset test path must make db() throw. NODE_ENV=test or shared module state alone is insufficient because inherited/default LORE_DB_PATH, cached project mappings, and stderr suppression can leak across tests or mutate the live Lore database.x-lore-gateway-token; provider bearer/API-key headers never authorize Lore. Remote access must fail closed without an exact configured-token match, and the gateway token must be removed before parsing and never forwarded, logged, stored, placed in URLs, or passed via CLI arguments.LORE_UPSTREAM_EXTRA_HEADERS may be attached only to configured Anthropic, OpenAI, and worker bases. Caller-selected origins receive no credentials and must satisfy normalized HTTPS LORE_CALLER_UPSTREAM_ALLOWLIST; credentials, paths, queries, fragments, wildcards, and normalized duplicates are rejected, and an unset allowlist denies all caller-selected origins.applyLoreProviderConfig must authoritatively set options.headerTimeout = false for Lore-routed openai and openai-codex providers because OpenCode has already merged its inherited 60-second timeout and Lore owns the foreground deadline. Routing must use cfg.provider and options.baseURL, not provider-specific base-URL environment variables, and an openai provider entry must be created when absent.{ type: "server_error", message: "Gateway request failed" } payloads, preserving only upstream status and bounded allowlisted retry metadata.private-in-progress-model and private-visible-in-progress-model, assert they are absent from client output, completions, and logs, and include identity-change rejection; standard stream tests reject provider diagnostics after response.in_progress but before response.created, and before response.created."projects trusted in-progress metadata before a provider failure" accepts trusted identity/model from response.created (resp_visible_in_progress_failure, gpt-5.6-terra, created_at: 456), receives hostile model private-visible-in-progress-model in response.in_progress, and then receives response.failed. Expected behavior: hostile model is absent from output and completion state, logs equal ["openai-responses provider failure"], recall/follow-up do not run, and completion is unsuccessful with trusted ID/model, empty content/raw items, and usage { inputTokens: 7, outputTokens: 3 }."restores principal state when a later terminal item fails reconciliation" sends two accepted text items (first, second) and then a malformed terminal output containing secret private-late-terminal-mutation and mismatched item ID wrong_second_item. Expected behavior: exactly one response.failed, public error text only, no secret leakage, unsuccessful completion retaining both accepted text items, and usage reset to { inputTokens: 0, outputTokens: 0 }."restores principal state when terminal usage is malformed" uses response ID resp_atomic_usage, model gpt-5.6-terra, accepted text "safe before malformed usage", and secret marker private-malformed-terminal-usage.lpmvqrur at commit 1512d486a34f36accc9a6d522247a75c9a52fffe was initially empty and described as fix(responses): unify provider failure handling; parent wswlsmrn was commit 24880457763b6f10831856d01c41bd72d62ddc28, described as fix(responses): reject non-monotonic provider failures.fix/responses-private-references had conflicts requiring inspection with jj bookmark list and resolution via jj bookmark set <name> -r <rev>.packages/gateway/src/stream/openai-responses.ts defines public text PUBLIC_GATEWAY_ERROR = "Gateway request failed" and exported log message RESPONSES_PROVIDER_FAILURE_LOG = "openai-responses provider failure".sanitizeResponsesProviderFailureTerminal() recognizes error, response.error, failed/cancelled response.failed, and failed/cancelled response.done; it emits only response.failed with trusted state fields, output: [], usage: null, and error { type: "server_error", message: "Gateway request failed" }. It emits lastAcceptedSequenceNumber + 1 only when the last accepted sequence is below Number.MAX_SAFE_INTEGER.projectResponsesInProgressEvent() projects response.in_progress from trusted response.created state: trusted ID/model/creation time, object normalized to "response", status "in_progress", and empty output; only the parsed sequence number is preserved.validateResponsesSourceSequence() accepts an absent sequence number but throws "malformed Responses stream event" when a provided value is not a safe integer, is negative, or is less than or equal to the last accepted sequence number.24880457763b6f10831856d01c41bd72d62ddc28 affected 4 files: packages/gateway/src/pipeline.ts, packages/gateway/src/stream/openai-responses.ts, packages/gateway/test/openai-responses-recall-aware-stream.test.ts, and packages/gateway/test/openai-responses-stream.test.ts; diff size was 244 insertions and 20 deletions.packages/gateway/src/pipeline.ts β 00c6939912f4f3d79457872d427b47eccc0f60bb917d4ea6aa7cde512e6af260; packages/gateway/src/stream/openai-responses.ts β 47f5c9c6ba1a43316698356d0d1e99412a57618434ae351e999260bc313bd808; packages/gateway/test/openai-responses-recall-aware-stream.test.ts β e65685c2d3f25a50123f4549873ba27e70d2ff62bd6a0e6d6dadfce952cf3cfb; packages/gateway/test/openai-responses-stream.test.ts β ff1a6064d4ac58107c830ea6519afd09dbaa21f782ff2fb3f849c81943eb31dc.packages/gateway/test/pipeline-streaming.test.ts β d9f6777bd96c6fe0b9f1cf028b5f82843284bcc08c492130c96d9bd82c894ba8 and packages/gateway/test/recall-codex-stream.test.ts β fc65ee28f054d358a744ab8a62ac22001fa7fb03f8971816cb83998995541d6d./usr/bin/bash could not find python: /usr/bin/bash: line 1: python: command not found.