Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
beyang committed Jan 18, 2025
1 parent 61512db commit 2757dbe
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
25 changes: 17 additions & 8 deletions vscode/src/chat/agentic/ToolboxManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,27 @@ class ToolboxManager {
}

public getSettings(): AgentToolboxSettings | null {
if (!this.isEnabled) {
return null
}
const { agent, shell } = this.getStoredUserSettings()
const shellError = this.getFeatureError('shell')
return {
agent: { name: this.isRateLimited ? undefined : agent },
agent: {
name: 'deep-cody',
},
shell: {
enabled: !!agent && !!shell && !shellError,
error: shellError,
enabled: true,
error: this.getFeatureError('shell'),
},
}
// if (!this.isEnabled) {
// return null
// }
// const { agent, shell } = this.getStoredUserSettings()
// const shellError = this.getFeatureError('shell')
// return {
// agent: { name: this.isRateLimited ? undefined : agent },
// shell: {
// enabled: !!agent && !!shell && !shellError,
// error: shellError,
// },
// }
}

public setIsRateLimited(hasHitLimit: boolean): void {
Expand Down
2 changes: 2 additions & 0 deletions vscode/src/chat/chat-view/ChatController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ export class ChatController implements vscode.Disposable, vscode.WebviewViewProv
chatClient: this.chatClient,
})

console.log('# selectedAgent:', selectedAgent, 'agentName:', agentName)

recorder.setIntentInfo({
userSpecifiedIntent:
manuallySelectedIntent ?? this.featureCodyExperimentalOneBox ? 'auto' : 'chat',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type SerializedPromptEditorValue,
serializedPromptEditorStateFromChatMessage,
} from '@sourcegraph/cody-shared'
import { type PromptEditorRefAPI, useExtensionAPI, useObservable } from '@sourcegraph/prompt-editor'
import type { PromptEditorRefAPI } from '@sourcegraph/prompt-editor'
import isEqual from 'lodash/isEqual'
import { ColumnsIcon } from 'lucide-react'
import { type FC, memo, useMemo } from 'react'
Expand All @@ -17,7 +17,6 @@ import { HumanMessageEditor } from './editor/HumanMessageEditor'
import { Tooltip, TooltipContent, TooltipTrigger } from '../../../../components/shadcn/ui/tooltip'
import { getVSCodeAPI } from '../../../../utils/VSCodeApi'
import { useConfig } from '../../../../utils/useConfig'
import { ToolboxButton } from './editor/ToolboxButton'

interface HumanMessageCellProps {
message: ChatMessage
Expand Down Expand Up @@ -96,10 +95,10 @@ const HumanMessageCellContent = memo<HumanMessageCellContent>(props => {
intent,
} = props

const api = useExtensionAPI()
const { value: settings } = useObservable(
useMemo(() => api.toolboxSettings(), [api.toolboxSettings])
)
// const api = useExtensionAPI()
// const { value: settings } = useObservable(
// useMemo(() => api.toolboxSettings(), [api.toolboxSettings])
// )

return (
<BaseMessageCell
Expand All @@ -113,9 +112,10 @@ const HumanMessageCellContent = memo<HumanMessageCellContent>(props => {
speakerTitle={userInfo.user.displayName ?? userInfo.user.username}
cellAction={
<div className="tw-flex tw-gap-2 tw-items-center tw-justify-end">
{settings && (
{/* {settings && (
<ToolboxButton settings={settings} api={api} isFirstMessage={isFirstMessage} />
)}
)} */}
<span>Test</span>
{isFirstMessage && <OpenInNewEditorAction />}
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const ToolboxButton: FC<ToolboxButtonProps> = memo(({ settings, api, isFi
className="tw-w-8 tw-h-8 tw-text-muted-foreground"
/>
)}
{isFirstMessage && <span className="tw-font-semibold">agentic chat</span>}
{isFirstMessage && <span className="tw-font-semibold">foobar agentic chat</span>}
</Button>
</ToolbarPopoverItem>
</div>
Expand Down

0 comments on commit 2757dbe

Please sign in to comment.