Repository navigation
feat(api): abort signal support for openai, openai-compatible base, zai, kimi-code (round 2) #1311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
easonLiangWorldedtech
wants to merge
59
commits into
Zoo-Code-Org:main
Choose a base branch
from
easonLiangWorldedtech:feat/abort-r2-openai-family
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
e61feb1
feat(api): add throwIfAborted helper and completePrompt options regre…
easonliang28 e65cc08
feat(api): abort signal support for openai, openai-compatible base, z…
easonLiangWorldedtech 4a31692
test(providers): export APIUserAbortError from openai mock in firewor…
easonLiangWorldedtech 35c95ea
fix(api): normalize abort errors raised during stream iteration
easonLiangWorldedtech 217f120
test(providers): cover the base_resp stream error path through the it…
easonLiangWorldedtech af320da
test(providers): cover remaining branch partials in base provider and…
easonLiangWorldedtech a0117fb
feat(api): add shared isRequestAborted and createAbortError helpers t…
easonLiangWorldedtech 36f0b42
Merge branch 'feat/abort-r1-foundation' into feat/abort-r2-openai-family
easonLiangWorldedtech 8632025
Merge remote-tracking branch 'upstream/main' into feat/abort-r2-opena…
easonliang28 20b1228
test(zai): align GLM-5.3-Flash expectations with abort-signal request…
easonliang28 8ce2489
refactor(api): dedupe handleOpenAIRequestError and strengthen abort-s…
easonliang28 cb77e0c
fix(api): reject pre-aborted Kimi requests and forward per-request ti…
easonliang28 c9311dc
fix(api): forward per-request timeoutMs and harden abort specs
easonliang28 707ddf7
Merge upstream/main (79cd12f2c) into feat/abort-r2-openai-family
easonliang28 0703c58
fix(ci): declare vitest as a root devDependency so the mutation gate …
easonliang28 09a0c80
test(api): strengthen focused tests for the changed-code mutation gate
easonliang28 805f297
test(api): exclude proven-equivalent Stryker mutants from the changed…
easonliang28 1e0b137
Merge branch 'main' into feat/abort-r2-openai-family
easonLiangWorldedtech 7b31a5b
Merge upstream/main (0d937c050) into feat/abort-r2-openai-family
easonliang28 42bcdab
Merge remote-tracking branch 'upstream/main' into feat/abort-r2-opena…
easonliang28 35b1d10
Merge branch main into feat/abort-r2-openai-family
easonliang28 bccf293
test(api): cover captureError non-Error re-wrap and resolving-contrac…
easonliang28 74e406e
test(api): add abort-aware error-handler tests and assert Kimi retry …
easonliang28 a3be5ec
Merge branch 'main' into feat/abort-r2-openai-family
easonLiangWorldedtech 25b6446
Merge remote-tracking branch 'upstream/main' into feat/abort-r2-opena…
easonliang28 393b516
fix(api): enforce abort-signal loop defense in openai-family streamin…
easonliang28 7dc331f
Merge branch 'main' into feat/abort-r2-openai-family
easonLiangWorldedtech 4db5623
chore(deps): regenerate pnpm-lock.yaml after main merge
4238bd1
fix(deps): bump vitest 4.1.9 -> 4.1.11 (dependency-review advisory)
34a87d5
test(visual): regenerate electron chat-dark sidebar reference for #1311
9ece5d9
test(visual): restore original chat-dark sidebar reference
ac0c847
test(openai): make the timeout-only signal test observe the abort
c44241b
test(kimi-code): keep the SDK create signature in the spy helper
c2ad99c
Merge remote-tracking branch 'upstream/main' into feat/abort-r2-opena…
833f5eb
chore: trigger label reconcile (CI green + CR approved, cron stalled)
74f5113
Merge commit 'refs/shapes/upstream-main' into feat/abort-r2-openai-fa…
cbcc610
Merge upstream main (3859e5dd8) into feat/abort-r2-openai-family
fe2cca9
Re-trigger review at the current head
dbe734f
Distinguish a request timeout from a user cancellation
c81a73f
Re-trigger review at head: all required checks green and every review…
ebf71a1
Cover timeout classification through the provider call path
49467c8
Keep boolean base_resp status codes reported as errors
7a2d9da
Match the status_msg fallback between the two paths
1d087ac
Merge branch 'main' into feat/abort-r2-openai-family
easonLiangWorldedtech cd52589
test(api): pin the two-argument create() call in the completePrompt a…
a18aee8
Merge upstream/main into feat/abort-r2-openai-family
833268c
fix(api): cancel Kimi model discovery with the caller, and pin the fl…
17ab14d
test(api): pin Kimi cancellation that lands during model preparation
1b248f0
test(api): pin the Kimi signal fallback in the model cache
6e46bc7
Merge upstream/main 995167eed into feat/abort-r2-openai-family
easonliang28 9798cf1
style: satisfy the compile job format:check gate on this PR's files
easonliang28 e12539a
Merge upstream main (285f6687a) into feat/abort-r2-openai-family
easonliang28 7f085ab
Address review: keep the discovery attempt open across cancellation
easonliang28 5525ff0
Merge upstream/main (58341d882) into feat/abort-r2-openai-family
easonliang28 0dc3ca5
chore(api): remove Stryker suppression comments from touched files
easonliang28 9a9f1da
fix(api): reject non-finite and cap overflowing mergeAbortSignalAndTi…
easonliang28 f257a54
fix(api): round fractional timeouts before AbortSignal.timeout
easonliang28 e3360c1
test(api): assert the rounded delay reaching AbortSignal.timeout
easonliang28 6088f40
fix(api): forward discovery cancellation into the Kimi catalog fetch
easonliang28 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/api/providers/__tests__/complete-prompt-options.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { describe, it, expect } from "vitest" | ||
|
|
||
| import type { CompletePromptOptions } from "../../index" | ||
|
|
||
| describe("CompletePromptOptions", () => { | ||
| it("should allow abortSignal property", () => { | ||
| const controller = new AbortController() | ||
| const options: CompletePromptOptions = { abortSignal: controller.signal } | ||
| expect(options.abortSignal).toBe(controller.signal) | ||
| }) | ||
|
|
||
| it("should allow timeoutMs property", () => { | ||
| const options: CompletePromptOptions = { timeoutMs: 5000 } | ||
| expect(options.timeoutMs).toBe(5000) | ||
| }) | ||
|
|
||
| it("should allow both abortSignal and timeoutMs together", () => { | ||
| const controller = new AbortController() | ||
| const options: CompletePromptOptions = { abortSignal: controller.signal, timeoutMs: 10000 } | ||
| expect(options.abortSignal).toBe(controller.signal) | ||
| expect(options.timeoutMs).toBe(10000) | ||
| }) | ||
|
|
||
| it("should allow empty options object", () => { | ||
| const options: CompletePromptOptions = {} | ||
| expect(options.abortSignal).toBeUndefined() | ||
| expect(options.timeoutMs).toBeUndefined() | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.