diff --git a/vscode/src/completions/inline-completion-item-provider.test.ts b/vscode/src/completions/inline-completion-item-provider.test.ts index 59ea77169e74..0f4272cc5ac8 100644 --- a/vscode/src/completions/inline-completion-item-provider.test.ts +++ b/vscode/src/completions/inline-completion-item-provider.test.ts @@ -128,7 +128,8 @@ describe('InlineCompletionItemProvider', () => { // Check if the trigger delay is respected const elapsedTime = Date.now() - startTime - expect(elapsedTime).toBeGreaterThanOrEqual(triggerDelay) + // Note: we add 1.0 here for some buffer to reduce flakiness (https://github.com/sourcegraph/cody/actions/runs/12587968355/job/35084898262?pr=6492) + expect(elapsedTime + 1.0).toBeGreaterThanOrEqual(triggerDelay) // We only check for greater than because a less than would vary depending on the CI machine // Switch to fake timers for precise control diff --git a/vscode/webviews/chat/cells/messageCell/human/HumanMessageCell.story.tsx b/vscode/webviews/chat/cells/messageCell/human/HumanMessageCell.story.tsx index 9c03123f1d27..72332a6cee43 100644 --- a/vscode/webviews/chat/cells/messageCell/human/HumanMessageCell.story.tsx +++ b/vscode/webviews/chat/cells/messageCell/human/HumanMessageCell.story.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' -import { PromptString, ps } from '@sourcegraph/cody-shared' +import { FIXTURE_MODEL, PromptString, ps } from '@sourcegraph/cody-shared' import { ExtensionAPIProviderForTestsOnly, MOCK_API } from '@sourcegraph/prompt-editor' import { Observable } from 'observable-fns' import { URI } from 'vscode-uri' @@ -63,7 +63,7 @@ export const WithInitialContext: StoryObj = { Observable.of([]), + chatModels: () => Observable.of([FIXTURE_MODEL]), defaultContext: () => Observable.of({ initialContext: [ @@ -95,7 +95,7 @@ export const WithInitialContextFileTooLarge: StoryObj = { Observable.of([]), + chatModels: () => Observable.of([FIXTURE_MODEL]), defaultContext: () => Observable.of({ initialContext: [ diff --git a/vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx b/vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx index 9683d4e35ed2..26d4ac10acfa 100644 --- a/vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx +++ b/vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx @@ -87,7 +87,6 @@ export const HumanMessageEditor: FunctionComponent<{ onChange, onSubmit: parentOnSubmit, onStop, - isFirstInteraction, isLastInteraction, isEditorInitiallyFocused, className, @@ -390,7 +389,7 @@ export const HumanMessageEditor: FunctionComponent<{ ) ) - const currentChatModel = useMemo(() => models[0], [models[0]]) + const currentChatModel = useMemo(() => (models ? models[0] : undefined), [models, models?.[0]]) const defaultContext = useDefaultContextForChat() useEffect(() => {