Skip to content

fix: keep @types/bun 1.4.0 compatible and preserve #265 error propagation - #272

Merged
tickernelz merged 11 commits into
mainfrom
fix/dependabot-types-bun-1-4
Aug 25, 2026
Merged

fix: keep @types/bun 1.4.0 compatible and preserve #265 error propagation#272
tickernelz merged 11 commits into
mainfrom
fix/dependabot-types-bun-1-4

Conversation

@tickernelz

Copy link
Copy Markdown
Owner

Summary

Two integration fixes required by the #271 + #254 + #252 batch:

  1. bun-types pinned to 1.3.14 via overrides. Dependabot bumped @types/bun to 1.4.0; bun-types 1.4.0 narrows the NodeJS.Process event surface (adds memoryPressure, drops the general signal signatures), which breaks process.on("SIGINT"/"SIGTERM"/"beforeExit"/"exit") typecheck in src/index.ts. The override keeps @types/bun current while restoring the previous type surface.
  2. Preserve fix: preserve provider errors in user profile learning #265/fix: preserve provider errors in user profile learning #267 error propagation. fix: correctness & data-integrity fixes across user profiles and turso sharding #252 added an outer catch in performUserProfileLearning that swallowed provider errors after logging, contradicting fix: preserve provider errors in user profile learning #267 (which deliberately re-throws the opencode provider error instead of masking it) and breaking its regression test. The catch now logs and rethrows; the idle-timer caller already has its own try/catch.

Verification

phil-lipp and others added 11 commits August 13, 2026 13:17
…ing_paths

The cold-start buffer was a single instance field on the profile-manager
singleton, so items observed for one user during embedding warm-up drained
into whichever user's mergeItems ran next — merging User A's preferences into
User B's profile. Key the buffer by profileId (Map) and drain only the current
profile's bucket; legacy unattributed buffer files are dropped on load.

Separately, createProfile/updateProfile rebuilt cleanedData as only
{preferences, patterns, workflows}, silently stripping learning_paths on every
write and rendering the Learning Paths injection feature dead. Carry the field
through.
rebuildProfileUsing dereferenced originalItem unconditionally in the merged-group
branch, so a keeper id the model hallucinated (present only in its mapping, not
in originalById) threw and aborted the entire cleanup run. Skip such groups, and
normalize the AI-controlled mapping (kept/merged/removed) to well-formed arrays so
a malformed response degrades to a no-op cleanup instead of throwing.

getUserProfileContext parsed the stored profileData with no guard, so one corrupt
row broke context injection for every request. Wrap in try/catch and return null.
…ialization

Three fire-and-forget/unawaited hazards in the learning cycle:

- The retry-exhausted branch did not await markMultipleAsUserLearningCaptured, so
  finally cleared isLearningRunning while the write was in flight; the next cycle
  re-fetched and re-analyzed the same prompts (token burn), and the rejection was
  unhandled. Await it.
- evolveAndUpdate mutates item.description/centroid in place but was called
  fire-and-forget, racing the JSON.stringify in updateProfile — the evolved
  description was included or lost nondeterministically. Make applyValidations
  async and await the evolve so mutation completes pre-serialization.
- performUserProfileLearning had try/finally but no catch; JSON.parse of a corrupt
  profileData row rejected the promise (unhandled at the fire-and-forget site). Add
  a catch that logs and returns.
…ck cleanup

- createShard committed the registry INSERT before initShardDb ran; if init threw
  (disk full, permissions) the row persisted pointing at an uninitialized file, so
  the next getWriteShard failed isShardValid and threw 'incompatible or corrupt',
  blocking all writes to that scope. Initialize the shard DB first (it is
  idempotent), then insert.
- getShardByPath matched db_path with LIKE '%' || filename, so the underscores in
  shard names (user_<hash>_shard_N.db) acted as single-char wildcards and could
  match the wrong row. Anchor on the '/' separator and escape LIKE metacharacters.
- readLiveLock called unlinkSync outside its try/catch; a race (already removed) or
  a Windows open handle threw ENOENT/EPERM out of assertNoTursoMigrationInProgress
  and falsely blocked writes. Wrap it.
Asserts that items buffered for one profile during embedding cold-start never
drain into another profile's merge, and that each bucket drains only for its own
profile.
Add an `orcarouter` memoryProvider mode backed by a dedicated
OrcaRouterProvider that extends the OpenAI Chat Completions provider.

OrcaRouter (https://www.orcarouter.ai) is an OpenAI-compatible model
gateway that requires namespaced model IDs. When `memoryApiUrl` and
`memoryModel` are omitted they default to the gateway endpoint
(https://api.orcarouter.ai/v1) and the `orcarouter/auto` routing alias,
so a minimal config only needs `memoryProvider` + `memoryApiKey`. A bare
model name is rejected with a hint instead of surfacing a gateway-side
model_not_found error. The provider is tagged `orcarouter` in the AI
session store and diagnostics.

The base OpenAIChatCompletionProvider gains protected sessionProviderTag /
resolveEndpoint / resolveModel hooks so subclasses can override endpoint,
model, and session tagging without duplicating request handling.

Co-Authored-By: Claude <noreply@anthropic.com>
… 9 updates

Bumps the minor-and-patch group with 4 updates in the / directory: @opencode-ai/plugin, [@opencode-ai/sdk](https://github.com/sst/opencode-sdk-js), [hono](https://github.com/honojs/hono) and [@types/bun](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/bun).
Bumps the minor-and-patch group with 5 updates in the /web directory:

| Package | From | To |
| --- | --- | --- |
| [dompurify](https://github.com/cure53/DOMPurify) | `3.4.13` | `3.4.14` |
| [marked](https://github.com/markedjs/marked) | `18.0.9` | `18.0.10` |
| [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) | `6.0.5` | `6.1.0` |
| [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) | `1.31.0` | `1.33.0` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `8.2.1` | `8.2.2` |



Updates `@opencode-ai/plugin` from 1.18.18 to 1.18.19

Updates `@opencode-ai/sdk` from 1.18.18 to 1.18.19
- [Release notes](https://github.com/sst/opencode-sdk-js/releases)
- [Changelog](https://github.com/anomalyco/opencode-sdk-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sst/opencode-sdk-js/commits)

Updates `hono` from 4.13.2 to 4.13.3
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](honojs/hono@v4.13.2...v4.13.3)

Updates `@types/bun` from 1.3.14 to 1.4.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/bun)

Updates `dompurify` from 3.4.13 to 3.4.14
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](cure53/DOMPurify@3.4.13...3.4.14)

Updates `marked` from 18.0.9 to 18.0.10
- [Release notes](https://github.com/markedjs/marked/releases)
- [Commits](markedjs/marked@v18.0.9...v18.0.10)

Updates `@vitejs/plugin-react` from 6.0.5 to 6.1.0
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@6.1.0/packages/plugin-react)

Updates `lucide-react` from 1.31.0 to 1.33.0
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/1.33.0/packages/lucide-react)

Updates `vite` from 8.2.1 to 8.2.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.2.2/packages/vite)

---
updated-dependencies:
- dependency-name: "@opencode-ai/plugin"
  dependency-version: 1.18.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: "@opencode-ai/sdk"
  dependency-version: 1.18.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: hono
  dependency-version: 4.13.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: "@types/bun"
  dependency-version: 1.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: dompurify
  dependency-version: 3.4.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: marked
  dependency-version: 18.0.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 6.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: lucide-react
  dependency-version: 1.33.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: vite
  dependency-version: 8.2.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…h-f0ad1952e0

chore(deps): bump the minor-and-patch group across 2 directories with 9 updates
feat: add named orcarouter memory provider mode
fix: correctness & data-integrity fixes across user profiles and turso sharding
…tion

- pin bun-types to 1.3.14 via overrides: @types/bun 1.4.0 narrows the
  NodeJS.Process event surface (memoryPressure-only), which breaks
  process.on(SIGINT/SIGTERM/beforeExit/exit) typecheck on main
- rethrow in performUserProfileLearning after logging so provider errors
  keep propagating per #267/#265 instead of being silently swallowed
@tickernelz
tickernelz merged commit 4382693 into main Aug 25, 2026
14 checks passed
@tickernelz
tickernelz deleted the fix/dependabot-types-bun-1-4 branch August 25, 2026 04:44
This was referenced Aug 25, 2026
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.

3 participants