Skip to content

fix(reads): keep heavy worker failures off the gateway thread - #1890

Merged
BYK merged 3 commits into
mainfrom
fix/1736-read-worker-failure-policy
Sep 24, 2026
Merged

BYK merged 3 commits into
mainfrom
fix/1736-read-worker-failure-policy

Conversation

@BYK

@BYK BYK commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Closes #1736. Part of #1708.

What changed

  • Make heavy read worker failures explicit: optional reads degrade while required knowledge and distillation reads return a retryable preparation error.
  • Prevent unavailable, timed-out, and broken worker paths from rerunning heavy scans synchronously on the gateway thread.
  • Preserve frozen knowledge and durable prompt deltas when context-source FTS fails, and make direct compaction retryable when required reads are unavailable.
  • Add regression coverage for worker failures, distillation prewarm, context selection, vector reads, and gateway/compaction behavior.

Validation

  • Focused read-offload, LTM context, pipeline streaming, and compaction tests: 219 passed.
  • Core/gateway/OpenCode/Pi/UI TypeScript checks, lint and formatting: passed.
  • Full Vitest run: 11,279 passed, 233 skipped, 3 failed. The failing tests involve this environment's pnpm wrapper trying an unattended dependency reinstall (fixture and test-shard subprocesses) and absent optional ONNX GPU assets; bundle-exports could not build for the same pnpm reason. No changed-path tests failed.
  • Adversarial correctness review found and fixed a failed-FTS/pinned-context gap, with regression coverage.
  • Devin's Layer 4 refresh findings: tests prove the worker failure returns 503 and an unsent first-injection delta is reselected on retry. Both regressions failed before their fixes; 182 gateway tests, gateway typecheck, lint, and formatting passed.

The current Git tree hash matches the validated local tree (3c192911372716c1e8a0afe05bdb9833657512ae).


Devin Review

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-24 14:52 UTC

devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ Patch coverage is 84.78% (78 of 92 changed executable lines covered; target 80%).
Project statement coverage is 84.49% (up 0.01 percentage points from base (e6ec679) to head (a1e1b60)).

Changed files with executable lines (11)
File Patch coverage Changed executable lines
packages/gateway/src/pipeline.ts 60.71% 17/28 covered; missed: 3914, 3930, 19823, 19824, 19825, 19826, 19827, 19831, 19834, 19835, 19838; partial branches: 19299, 19665, 19669
packages/core/src/ltm.ts 100.00% 13/13 covered; partial branches: 2474, 3324, 3430, 3669, 3732
packages/core/src/embedding/search.ts 70.00% 7/10 covered; missed: 39, 61, 62; partial branches: 38
packages/core/src/lat-reader.ts 100.00% 3/3 covered; partial branches: 386
packages/core/src/recall.ts 100.00% 1/1 covered; partial branches: 323
packages/core/src/db.ts 100.00% 4/4 covered
packages/core/src/entities.ts 100.00% 1/1 covered
packages/core/src/gradient.ts 100.00% 1/1 covered
packages/core/src/read-offload.ts 100.00% 12/12 covered
packages/core/src/temporal.ts 100.00% 1/1 covered
packages/core/src/vector-pool.ts 100.00% 18/18 covered
Coverage diff
@@            Coverage Diff             @@
##          main     #1890       +/-##
==========================================
+ Coverage    84.48%    84.49%    +0.01%
==========================================
  Files          304       304         —
  Tracked lines     47640     47700       +60
  Branches     38639     38697       +58
==========================================
+ Hits         40247     40302       +55
- Misses        7393      7398        +5
- Partials      4154      4160        +6

Generated by Coverage Action

devin-ai-integration[bot]

This comment was marked as resolved.

@BYK
BYK merged commit ccd60a9 into main Sep 24, 2026
36 of 37 checks passed
@BYK
BYK deleted the fix/1736-read-worker-failure-policy branch September 24, 2026 14:51
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.

fix(reads): keep heavy worker failures off the gateway thread

1 participant