diff options
| author | Dax Raad <[email protected]> | 2025-11-04 13:32:56 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-11-04 13:35:44 -0500 |
| commit | 7a7060ef156451c90137cfccd74a59e3f3e40f68 (patch) | |
| tree | 3b7b99607baf50ca4b571ca29e97c8f7ce7c5f2c /packages/sdk | |
| parent | f9af9fc22184c5e4a62a18a2df6746d6a1945264 (diff) | |
| download | opencode-7a7060ef156451c90137cfccd74a59e3f3e40f68.tar.gz opencode-7a7060ef156451c90137cfccd74a59e3f3e40f68.zip | |
fix session performance issue from large diffs
Diffstat (limited to 'packages/sdk')
| -rw-r--r-- | packages/sdk/js/src/gen/sdk.gen.ts | 9 | ||||
| -rw-r--r-- | packages/sdk/js/src/gen/types.gen.ts | 22 |
2 files changed, 27 insertions, 4 deletions
diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts index b76b6996f..1a54da8fa 100644 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ b/packages/sdk/js/src/gen/sdk.gen.ts @@ -55,6 +55,7 @@ import type { SessionShareErrors, SessionDiffData, SessionDiffResponses, + SessionDiffErrors, SessionSummarizeData, SessionSummarizeResponses, SessionSummarizeErrors, @@ -475,12 +476,16 @@ class Session extends _HeyApiClient { } /** - * Get the diff that resulted from this user message + * Get the diff for this session */ public diff<ThrowOnError extends boolean = false>( options: Options<SessionDiffData, ThrowOnError>, ) { - return (options.client ?? this._client).get<SessionDiffResponses, unknown, ThrowOnError>({ + return (options.client ?? this._client).get< + SessionDiffResponses, + SessionDiffErrors, + ThrowOnError + >({ url: "/session/{id}/diff", ...options, }) diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index 7293f13cd..d4b763324 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -527,7 +527,9 @@ export type Session = { directory: string parentID?: string summary?: { - diffs: Array<FileDiff> + additions: number + deletions: number + diffs?: Array<FileDiff> } share?: { url: string @@ -1882,6 +1884,9 @@ export type SessionShareResponse = SessionShareResponses[keyof SessionShareRespo export type SessionDiffData = { body?: never path: { + /** + * Session ID + */ id: string } query?: { @@ -1891,9 +1896,22 @@ export type SessionDiffData = { url: "/session/{id}/diff" } +export type SessionDiffErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * Not found + */ + 404: NotFoundError +} + +export type SessionDiffError = SessionDiffErrors[keyof SessionDiffErrors] + export type SessionDiffResponses = { /** - * Successfully retrieved diff + * List of diffs */ 200: Array<FileDiff> } |
