Skip to content

Commit

Permalink
bump openctx for quieter provider errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs committed Sep 20, 2024
1 parent de22fc8 commit 0cba331
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 34 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"vitest": "^2.0.5"
},
"dependencies": {
"@openctx/client": "^0.0.28",
"@openctx/client": "^0.0.29",
"@sourcegraph/telemetry": "^0.18.0",
"ignore": "^5.3.1",
"observable-fns": "^0.6.1",
Expand All @@ -88,6 +88,9 @@
}
}
},
"neverBuiltDependencies": ["deasync", "playwright"]
"neverBuiltDependencies": [
"deasync",
"playwright"
]
}
}
36 changes: 24 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 67 additions & 16 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@
"version-bump:patch": "RELEASE_TYPE=patch ts-node-transpile-only ./scripts/version-bump.ts",
"version-bump:dry-run": "RELEASE_TYPE=prerelease ts-node-transpile-only ./scripts/version-bump.ts"
},
"categories": ["AI", "Chat", "Programming Languages", "Machine Learning", "Snippets", "Education"],
"categories": [
"AI",
"Chat",
"Programming Languages",
"Machine Learning",
"Snippets",
"Education"
],
"keywords": [
"cody",
"codey",
Expand Down Expand Up @@ -119,7 +126,11 @@
},
"main": "./dist/extension.node.js",
"browser": "./dist/extension.web.js",
"activationEvents": ["onLanguage", "onStartupFinished", "onWebviewPanel:cody.editorPanel"],
"activationEvents": [
"onLanguage",
"onStartupFinished",
"onWebviewPanel:cody.editorPanel"
],
"contributes": {
"walkthroughs": [
{
Expand Down Expand Up @@ -712,13 +723,17 @@
},
{
"command": "cody.supercompletion.jumpTo",
"args": ["next"],
"args": [
"next"
],
"key": "shift+ctrl+down",
"when": "cody.activated && !editorReadonly && cody.hasActionableSupercompletion"
},
{
"command": "cody.supercompletion.jumpTo",
"args": ["previous"],
"args": [
"previous"
],
"key": "shift+ctrl+up",
"when": "cody.activated && !editorReadonly && cody.hasActionableSupercompletion"
}
Expand Down Expand Up @@ -976,12 +991,20 @@
"order": 2,
"type": "string",
"markdownDescription": "A Git repository URL to use instead of allowing Cody to infer the Git repository from the workspace.",
"examples": ["https://github.com/sourcegraph/cody", "ssh://[email protected]/sourcegraph/cody"]
"examples": [
"https://github.com/sourcegraph/cody",
"ssh://[email protected]/sourcegraph/cody"
]
},
"cody.useContext": {
"order": 99,
"type": "string",
"enum": ["embeddings", "keyword", "blended", "none"],
"enum": [
"embeddings",
"keyword",
"blended",
"none"
],
"default": "blended",
"markdownDescription": "Controls which context providers Cody uses for chat, commands and inline edits. Use 'blended' for best results. For debugging other context sources, 'embeddings' will use an embeddings-based index if available. 'keyword' will use a search-based index. 'none' will not use embeddings or search-based indexes."
},
Expand Down Expand Up @@ -1033,12 +1056,18 @@
"order": 6,
"type": "string",
"markdownDescription": "A custom instruction to be included at the start of all chat messages (e.g. \"Answer all my questions in Spanish.\")",
"examples": ["Answer all my questions in Spanish."]
"examples": [
"Answer all my questions in Spanish."
]
},
"cody.chat.defaultLocation": {
"order": 6,
"type": "string",
"enum": ["sticky", "sidebar", "editor"],
"enum": [
"sticky",
"sidebar",
"editor"
],
"markdownDescription": "Controls where the Cody chat view opens when the user invokes the `Cody: New Chat` command, or the Alt+L and Alt+/ shortcuts.",
"enumDescriptions": [
"Opens in the last-activated view location, which is set whenever the user explicitly chooses to open chat in a given location",
Expand All @@ -1051,7 +1080,9 @@
"order": 7,
"type": "string",
"markdownDescription": "A custom instruction to be included at the end of all instructions for edit commands (e.g. \"Write all unit tests with Jest instead of detected framework.\")",
"examples": ["Write all unit tests with Jest instead of detected framework."]
"examples": [
"Write all unit tests with Jest instead of detected framework."
]
},
"cody.codeActions.enabled": {
"order": 11,
Expand Down Expand Up @@ -1097,15 +1128,24 @@
"cody.telemetry.level": {
"order": 99,
"type": "string",
"enum": ["all", "off"],
"enumDescriptions": ["Sends usage data and errors.", "Disables all extension telemetry."],
"enum": [
"all",
"off"
],
"enumDescriptions": [
"Sends usage data and errors.",
"Disables all extension telemetry."
],
"markdownDescription": "Controls the telemetry about Cody usage and errors. See [Cody usage and privacy notice](https://about.sourcegraph.com/terms/cody-notice).",
"default": "all"
},
"cody.autocomplete.advanced.provider": {
"type": "string",
"default": "default",
"enum": ["default", "experimental-ollama"],
"enum": [
"default",
"experimental-ollama"
],
"enumDescriptions": [
"Our recommended setup with the best balance of quality and latency. We continuously update this for optimal performance.",
"Experimental support for Ollama users. Use `cody.autocomplete.experimental.ollamaOptions` to configure requests to Ollama server."
Expand All @@ -1129,7 +1169,10 @@
},
"cody.experimental.foldingRanges": {
"type": "string",
"enum": ["lsp", "indentation-based"],
"enum": [
"lsp",
"indentation-based"
],
"enumDescriptions": [
"Use folding ranges that are enabled by default in VS Code, and are usually powered by LSP",
"Use custom implementation of folding ranges that is indentation based. This is the implementation that is used by other Cody clients like the JetBrains plugin"
Expand All @@ -1140,7 +1183,13 @@
"cody.autocomplete.experimental.graphContext": {
"type": "string",
"default": null,
"enum": [null, "bfg", "bfg-mixed", "tsc", "tsc-mixed"],
"enum": [
null,
"bfg",
"bfg-mixed",
"tsc",
"tsc-mixed"
],
"markdownDescription": "Use the code graph to retrieve context for autocomplete requests."
},
"cody.autocomplete.experimental.fireworksOptions": {
Expand Down Expand Up @@ -1315,13 +1364,15 @@
"untrustedWorkspaces": {
"supported": "limited",
"description": "Cody only uses providers (configured in `openctx.providers`) from trusted workspaces because providers may execute arbitrary code.",
"restrictedConfigurations": ["openctx.providers"]
"restrictedConfigurations": [
"openctx.providers"
]
}
},
"dependencies": {
"@anthropic-ai/sdk": "^0.20.8",
"@openctx/provider-linear-issues": "^0.0.9",
"@openctx/vscode-lib": "^0.0.24",
"@openctx/vscode-lib": "^0.0.25",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/core": "^1.18.1",
"@opentelemetry/exporter-trace-otlp-http": "^0.45.1",
Expand Down
14 changes: 12 additions & 2 deletions vscode/src/context/openctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
authStatus,
combineLatest,
createDisposables,
debounceTime,
distinctUntilChanged,
featureFlagProvider,
graphqlClient,
Expand All @@ -28,7 +29,7 @@ import type {
} from '@openctx/client'
import type { createController } from '@openctx/vscode-lib'
import { Observable, map } from 'observable-fns'
import { logDebug, outputChannel } from '../log'
import { logDebug } from '../log'
import { gitMentionsProvider } from './openctx/git'
import LinearIssuesProvider from './openctx/linear-issues'
import RemoteDirectoryProvider, { createRemoteDirectoryProvider } from './openctx/remoteDirectorySearch'
Expand All @@ -52,6 +53,7 @@ export function exposeOpenCtxClient(
),
authStatus.pipe(
distinctUntilChanged(),
debounceTime(0),
mergeMap(auth =>
auth.authenticated
? promiseFactoryToObservable(signal =>
Expand All @@ -78,10 +80,16 @@ export function exposeOpenCtxClient(
? getMergeConfigurationFunction()
: undefined

if (!openctxOutputChannel) {
// Don't dispose this, so that it stays around for easier debugging even if the
// controller (or the whole extension) is disposed.
openctxOutputChannel = vscode.window.createOutputChannel('OpenCtx')
}

const controller = createController({
extensionId: context.extension.id,
secrets: context.secrets,
outputChannel,
outputChannel: openctxOutputChannel!,
features: isCodyWeb ? {} : { annotations: true, statusBar: true },
providers: isCodyWeb
? Observable.of(getCodyWebOpenCtxProviders())
Expand All @@ -102,6 +110,8 @@ export function exposeOpenCtxClient(
)
}

let openctxOutputChannel: vscode.OutputChannel | undefined

export function getOpenCtxProviders(
authStatusChanges: Observable<Pick<AuthStatus, 'endpoint'>>,
isValidSiteVersion: boolean
Expand Down
6 changes: 4 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
"main": "dist/index.js",
"types": "dist/lib/index.d.ts",
"sideEffects": true,
"files": ["dist/*"],
"files": [
"dist/*"
],
"scripts": {
"dev": "vite --mode development",
"build": "vite build --mode production && tsc --build",
"test": "vitest",
"build-ts": "tsc --build"
},
"devDependencies": {
"@openctx/vscode-lib": "^0.0.24",
"@openctx/vscode-lib": "^0.0.25",
"@sourcegraph/cody": "workspace:*",
"@sourcegraph/cody-shared": "workspace:*",
"@sourcegraph/prompt-editor": "workspace:*",
Expand Down

0 comments on commit 0cba331

Please sign in to comment.