GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — fix(plugin): honor abort signals in Promise plugin API calls by vimtor · Pull Request #65980 · anomalyco/opencode Conversation
|
| }).pipe(Effect.runPromiseWith(runtime))) as PromiseMethod | ||
| return ((input?: unknown, options?: { readonly signal?: AbortSignal }) => { | ||
| // The runner evaluates synchronously before it checks the signal, so an aborted call could start a mutation. | ||
| if (options?.signal?.aborted) return Promise.reject(options.signal.reason) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What the call rejects with depends on when the signal is aborted:
signal.reason, an AbortError, like fetch.Error: All fibers interrupted without error. I saw this in a real run with ctx.generate.text.Plugins that check error.name === "AbortError", as they would over HTTP, will miss the second case. Could the run reject with options.signal.reason whenever the signal is aborted? For example, add .catch((error) => Promise.reject(options?.signal?.aborted ? options.signal.reason : error)) to the run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Share the existing validated parser between the first-use and v22 patch tests without changing the staged runtime bytes. Upstream: anomalyco/opencode#65980 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
v2: plugin ctx.generate.text ignores the abort signal, so a cancelled generation keeps running
There was an error while loading. Please reload this page.