Skip to content

Commit

Permalink
Cody Ignore: Treat unterminated JSON responses as an outdated API err…
Browse files Browse the repository at this point in the history
…or message (#4024)
  • Loading branch information
dominiccooney committed May 2, 2024
1 parent d951e25 commit 5f2fc80
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/shared/src/sourcegraph-api/graphql/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1030,5 +1030,11 @@ export type LogEventMode =
| 'all' // log to both dotcom AND the connected instance

function hasOutdatedAPIErrorMessages(error: Error): boolean {
return error.message.includes('Cannot query field')
// Sourcegraph 5.2.3 returns an empty string ("") instead of an error message
// when querying non-existent codyContextFilters; this produces
// 'Unexpected end of JSON input'
return (
error.message.includes('Cannot query field') ||
error.message.includes('Unexpected end of JSON input')
)
}
10 changes: 10 additions & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ This is a log of all notable changes to Cody for VS Code. [Unreleased] changes a

### Added

### Fixed

- Fixed a bug where old Sourcegraph instances' error messages caused Cody to ignore all context files [pull/4024](https://github.com/sourcegraph/cody/pull/4024)

### Changed

## [1.16.0]

### Added

- Chat: The context window for the `Claude 3 Sonnet` and `Claude 3 Opus` models is now increased by default for all non-Enterprise users, without requiring a feature flag. [pull/3953](https://github.com/sourcegraph/cody/pull/3953)
- Custom Commands: Added the ability to create new custom Edit commands via the Custom Command Menu. [pull/3862](https://github.com/sourcegraph/cody/pull/3862)
- Custom Commands: Added 'currentFile' option to include the full file content in the Custom Commands menu. [pull/3960](https://github.com/sourcegraph/cody/pull/3960)
Expand Down

0 comments on commit 5f2fc80

Please sign in to comment.