-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(core,cli): replace full-history structuredClone with shallow/tail variants to prevent OOM on resume #4644
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
Changes from all commits
52eab19
981bbcf
8ddd862
b02bf69
5fbf8a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ function makeConfig(opts: MockOptions): { | |
| getFastModel: vi.fn(() => opts.fastModel ?? undefined), | ||
| getModel: vi.fn(() => 'qwen-plus'), | ||
| getGeminiClient: vi.fn(() => ({ | ||
| getHistoryShallow: () => opts.history ?? [], | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] Consider: getHistoryShallow: vi.fn(() => opts.history ?? []),Then assert in relevant tests: expect(config.getGeminiClient().getHistoryShallow).toHaveBeenCalled();Same applies to — qwen3.7-max via Qwen Code /review
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Acknowledged — intentionally kept as a plain function since the tests validate behavior (correct title output) rather than call-site wiring. Adding a spy assertion here would couple the test to an implementation detail that may change if we later switch back to a different accessor. |
||
| getChat: () => ({ | ||
| getHistory: () => opts.history ?? [], | ||
| }), | ||
|
|
@@ -202,7 +203,10 @@ describe('tryGenerateSessionTitle', () => { | |
| getFastModel: vi.fn(() => 'qwen-turbo'), | ||
| getModel: vi.fn(() => 'qwen-plus'), | ||
| getGeminiClient: vi.fn(() => ({ | ||
| getChat: () => ({ getHistory: () => history }), | ||
| getHistoryShallow: () => history, | ||
| getChat: () => ({ | ||
| getHistory: () => history, | ||
| }), | ||
| })), | ||
| getBaseLlmClient: vi.fn(() => ({ generateJson })), | ||
| } as unknown as Config; | ||
|
|
@@ -240,7 +244,10 @@ describe('tryGenerateSessionTitle', () => { | |
| getFastModel: vi.fn(() => 'qwen-turbo'), | ||
| getModel: vi.fn(() => 'qwen-plus'), | ||
| getGeminiClient: vi.fn(() => ({ | ||
| getChat: () => ({ getHistory: () => history }), | ||
| getHistoryShallow: () => history, | ||
| getChat: () => ({ | ||
| getHistory: () => history, | ||
| }), | ||
| })), | ||
| getBaseLlmClient: vi.fn(() => ({ generateJson })), | ||
| } as unknown as Config; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.