GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — (5/9) Dream, /btw and memory extraction retry a busy provider by Obed0101 · Pull Request #132 · MendCode/MendCode

Conversation

@Obed0101

@Obed0101 Obed0101 commented Nov 10, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Part 5 of 9, stacked on the previous part. Its diff is only this change.

CHANGELOG

  • Dream, /btw and memory extraction now wait out a busy or rate-limited provider and try again, instead of failing on the first overload.

Weight: one small module (completion-retry, about 40 lines) imported by the daemon entry; work only when a completion fails.

Checks: typecheck clean at this head; the full suite passed on the top of the stack (16240 pass).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Obed0101
Dream, /btw and memory extraction wait out a busy provider and retry …
43a0917
…instead of failing on the first overload
@Obed0101

Obed0101 commented Nov 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

MendCode: @Obed0101's MendCode worked on this pull request on one of its devices; released 2026-11-10 19:25 UTC.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Obed0101 Obed0101 mentioned this pull request Nov 10, 2026
(6/9) Code graph indexes a project repository nested in an ignoring folder #133
Merged
Obed0101
Obed0101 commented Nov 10, 2026
View reviewed changes

@Obed0101 Obed0101 left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MendCode review

No findings · nothing in this change was confirmed as a problem
head 43a091792e83

Merge risk: 🟡 Medium · This changes failure timing and request repetition in a shared provider-completion path, including interactive and background consumers. Regressions would appear as delayed failures, unwanted retries, or cancellation problems; the implementation bounds attempts and prevents replay after text output.
Change: Bug fix · Review effort: 2/5, about 15 minutes

The change adds bounded, abort-aware retries for transient provider failures in shared tool-less completions, without retrying after text has streamed. No introduced defects were verified in this stack-local diff; risk is medium because the shared integration also affects other auxiliary callers. Review was read-only, so tests were inspected but not run; the supplied performance measurements show no increase beyond measured noise.
Readers: 4 code files no reader could read went to the review pass whole (the diff is small: one reader call costs more than the readers' share of this review's cap, so the review pass reads it).
Stacked on #131: only this pull request's own commits since #131's head 0201e4d.

Walkthrough

A new async-generator wrapper retries a completion up to six times when the provider throws RetryableProviderError before emitting text. It uses the existing backoff schedule, honors longer provider retry-after delays, and stops waiting when cancelled. The daemon applies this wrapper in completeWithUsage, leaving provider routing, model guards, ordinary engine-turn retries, and response parsing unchanged.

Changes

Layer / files Summary
Completion retry and integration
packages/daemon/src/completion-retry.ts, packages/daemon/src/main.ts
Adds cancellable retry handling and integrates it into the shared completion path used by Dream, memory extraction, /btw, and other auxiliary callers.
Regression coverage
packages/daemon/test/completion-retry.test.ts
Adds six tests covering recovery, retry-after precedence, retry exhaustion, permanent failures, failure after streamed text, and cancellation.
Release notes
CHANGELOG.md
Documents automatic recovery from busy or rate-limited providers for Dream, /btw, and memory extraction.

Sequence diagram

sequenceDiagram
    participant Caller as Auxiliary caller
    participant Complete as completeWithUsage
    participant Retry as retryingCompletion
    participant Provider as Routed provider
    Caller->>Complete: Request completion with AbortSignal
    Complete->>Retry: Supply provider.stream attempt
    loop Initial attempt and up to six retries
        Retry->>Provider: stream(request)
        alt Retryable failure before text, retries remain
            Provider-->>Retry: RetryableProviderError
            Retry->>Retry: Abort-aware backoff / retry-after wait
        else Successful stream
            Provider-->>Retry: Model events
            Retry-->>Complete: Forward events
        else Non-retryable failure, text already emitted, or cancelled
            Retry-->>Complete: Propagate error
        end
    end
    Complete-->>Caller: Text and usage, or error
Loading
Pre-merge checks: ⚠️ 1 warning · ✅ 2 passed
Check Status Explanation
Title ✅ Passed The title accurately describes the retry behavior added for Dream, /btw, and memory extraction.
Description ✅ Passed The description explains the transient-failure problem, the retry module, and reported verification. It distinguishes typechecking at this head from full-suite testing at the top of the stack; neither result was independently executed during this review.
Out of scope ⚠️ Warning The shared completeWithUsage integration also changes retries for permission review, native advisor calls, and setup completions (packages/daemon/src/main.ts:796, :835, :1041). This broader effect is not mentioned in the title or description.
Review details
  • Files reviewed: 4 · 113 changed lines · estimated review effort 2/5, about 15 minutes
  • Profile: normal · at most 8 inline comments
  • Verification: the review pass raised no candidate findings, so no separate pass was needed
  • Cost: 194,266 tokens in (163,712 from the provider's cache) · 2,031 out
  • Readers: 4 code files no reader could read went to the review pass whole (the diff is small: one reader call costs more than the readers' share of this review's cap, so the review pass reads it).
  • Stacked on #131: only this pull request's own commits since #131's head 0201e4d.

Performance (perf-attrib, base 0201e4d against head 43a0917)

perf-attrib: igual: nothing above the measured noise

base 0201e4d5b29977b5ce181530f2cf9c2be5631efd (0201e4d5) vs cand 43a091792e8326c6f060a3272eaf65bad31d5590 (43a09179, cached build), median of 2 faux-engine session(s) per side; flagged = beyond the noise measured on 18 base-vs-base runs (x1.5).

metric base cand diff
tui.after.fp_mb 57.2 56.8 -0.4
tui.after.peak_mb 73 73.4 +0.4
tui.ready.fp_mb 54.7 54.9 +0.2
tui.ready.peak_mb 73 73.4 +0.4
tui.rest.fp_mb 56.8 56.4 -0.4
tui.rest.peak_mb 73 73.4 +0.4
tui.after.rss_mb 138.1 135.7 -2.4
tui.ready.rss_mb 113.9 114.1 +0.2
tui.rest.rss_mb 138.4 135.4 -3
tui.after.heap.extra_b 6703971 7013780 +309809
tui.after.heap.objects 240624 241489 +865
tui.after.heap.protected 19 19 0
tui.after.heap.size_b 24350371 24737428 +387057
tui.ready.heap.extra_b 2871847 2895010 +23163
tui.ready.heap.objects 216406 216472 +66
tui.ready.heap.protected 18 18 0
tui.ready.heap.size_b 19242551 19274430 +31879
tui.rest.heap.extra_b 4628046 4617393 -10653
tui.rest.heap.objects 237662 237640 -22
tui.rest.heap.protected 18 18 0
tui.rest.heap.size_b 22022446 22012222 -10224
tui.rest.js_code_b 5840000 5830816 -9184
tui.rest.js_live_b 19237656 19238071 +415
tui.cpu_ms.after 6020 6081 +61
tui.cpu_ms.ready 358 358 0
tui.cpu_ms.rest 542 533 -9
binary.bytes 72290528 72290528 0
disk.bytes 4111 4110 -1
disk.bytes_per_session 2056 2055 -1

JS object types that rose (count):

  • tui.after.heap.type.SQLStatement: 79 -> 88 (+9)
  • tui.after.heap.type.Object: 38152 -> 38158 (+6)
  • tui.ready.heap.type.FunctionExecutable: 14162 -> 14166 (+4)
  • tui.ready.heap.type.UnlinkedFunctionExecutable: 14149 -> 14153 (+4)

JS heap bytes by constructor that rose:

  • tui.rest.ctor.object:ModuleRecord.bytes: 5502260 -> 5502808 (+548)
  • tui.rest.ctor.native:Blob.bytes: 1738955 -> 1739095 (+140)
  • tui.rest.ctor.code:JSModuleEnvironment.bytes: 104144 -> 104176 (+32)

Modules loaded at start: 230 -> 230, 4630739 -> 4631287 bytes of chunks; chunk sizes only in cand: [1007138], only in base: [1006590] (chunk names are hashes: the list says which changed in size, not by what name)

Reference (skill, 2026-11-03, real model): footprint 64 ready / 66 after / peak 80 MB, 2.6 KB per session. This run (faux engine, whole process tree): 54.9 / 56.8 / peak 73.4 MB, 2055 B per session.

Files (4)
  • CHANGELOG.md
  • packages/daemon/src/completion-retry.ts
  • packages/daemon/src/main.ts
  • packages/daemon/test/completion-retry.test.ts

Comment @mendcode review to review again · @mendcode pause / resume · reply to a finding with explain, fix or learn · settings in .mendcode/review.yaml

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Base automatically changed from beta-pr/4-upgrade-docs to beta November 10, 2026 19:25
@Obed0101
Obed0101 merged commit b50ffbf into beta Nov 10, 2026
9 of 11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Obed0101
Obed0101 deleted the beta-pr/5-dream-retry branch November 10, 2026 19:25
@Obed0101 Obed0101 mentioned this pull request Nov 10, 2026
v0.0.14 #142
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Obed0101
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.