Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class AuxiliaryBarPart extends AbstractPaneCompositePart {
static readonly viewContainersWorkspaceStateKey = 'workbench.auxiliarybar.viewContainersWorkspaceState';

// Use the side bar dimensions
override readonly minimumWidth: number = 230; // Void changed this (was 170)
override readonly minimumWidth: number = 280; // Void changed this (was 170)
override readonly maximumWidth: number = Number.POSITIVE_INFINITY;
override readonly minimumHeight: number = 0;
override readonly maximumHeight: number = Number.POSITIVE_INFINITY;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/void/browser/_dummyContrib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { KeybindingWeight } from '../../../../platform/keybinding/common/keybind
import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js';


// to change this, just Cmd+Shift+F and replace DummyService with YourServiceName, and replace
// to change this, just Cmd+Shift+F and replace DummyService with YourServiceName, and create a unique ID below
export interface IDummyService {
readonly _serviceBrand: undefined; // services need this, just leave it undefined
}
Expand Down
24 changes: 5 additions & 19 deletions src/vs/workbench/contrib/void/browser/chatThreadService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ class ChatThreadService extends Disposable implements IChatThreadService {
// above just defines helpers, below starts the actual function
const { chatMode } = this._settingsService.state.globalSettings // should not change as we loop even if user changes it, so it goes here

console.log('a', chatMode)
// clear any previous error
this._setStreamState(threadId, { error: undefined }, 'set')

Expand All @@ -670,13 +669,11 @@ class ChatThreadService extends Disposable implements IChatThreadService {
let isRunningWhenEnd: IsRunningType = undefined
let aborted = false

console.log('b')
// before enter loop, call tool
if (callThisToolFirst) {
const { interrupted } = await this._runToolCall(threadId, callThisToolFirst.name, { preapproved: true, validatedParams: callThisToolFirst.params })
if (interrupted) return
}
console.log('c')

// tool use loop
while (shouldSendAnotherMessage) {
Expand All @@ -688,17 +685,14 @@ class ChatThreadService extends Disposable implements IChatThreadService {
let resMessageIsDonePromise: (toolCall?: RawToolCallObj | undefined) => void // resolves when user approves this tool use (or if tool doesn't require approval)
const messageIsDonePromise = new Promise<RawToolCallObj | undefined>((res, rej) => { resMessageIsDonePromise = res })

console.log('d')
// send llm message
this._setStreamState(threadId, { isRunning: 'LLM' }, 'merge')
const systemMessage = await this._generateSystemMessage(chatMode)
console.log('e0')
const llmMessages = await this._generateLLMMessages(threadId)
const messages: LLMChatMessage[] = [
{ role: 'system', content: systemMessage },
...llmMessages
]
console.log('e')

const llmCancelToken = this._llmMessageService.sendLLMMessage({
messagesType: 'chatMessages',
Expand Down Expand Up @@ -740,20 +734,14 @@ class ChatThreadService extends Disposable implements IChatThreadService {
break
}
this._setStreamState(threadId, { streamingToken: llmCancelToken }, 'merge') // new stream token for the new message
console.log('waiting...')
const toolCall = await messageIsDonePromise // wait for message to complete
console.log('done!')
if (aborted) { return }
console.log('H')
this._setStreamState(threadId, { streamingToken: undefined }, 'merge') // streaming message is done
console.log('I')

// call tool if there is one
const tool: RawToolCallObj | undefined = toolCall
if (tool) {
console.log('J')
const { awaitingUserApproval, interrupted } = await this._runToolCall(threadId, tool.name, { preapproved: false, unvalidatedToolParams: tool.rawParams })
console.log('K')

// stop if interrupted. we don't have to do this for llmMessage because we have a stream token for it and onAbort gets called, but we don't have the equivalent for tools.
// just detect tool interruption which is the same as chat interruption right now
Expand All @@ -768,17 +756,14 @@ class ChatThreadService extends Disposable implements IChatThreadService {
}

} // end while
console.log('L')


// if awaiting user approval, keep isRunning true, else end isRunning
this._setStreamState(threadId, { isRunning: isRunningWhenEnd }, 'merge')
console.log('M')

// add checkpoint before the next user message
if (!isRunningWhenEnd)
this._addUserCheckpoint({ threadId })
console.log('N')

// capture number of messages sent
this._metricsService.capture('Agent Loop Done', { nMessagesSent, chatMode })
Expand Down Expand Up @@ -969,7 +954,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
const [_, toIdx] = c
if (toIdx === fromIdx) return

console.log(`going from ${fromIdx} to ${toIdx}`)
// console.log(`going from ${fromIdx} to ${toIdx}`)

// update the user's checkpoint
this._addUserModificationsToCurrCheckpoint({ threadId })
Expand Down Expand Up @@ -1064,6 +1049,7 @@ We only need to do it for files that were edited since `from`, ie files between
severity: error ? Severity.Warning : Severity.Info,
message: error ? `Error: ${error} ` : `A new Chat result is ready.`,
source: messageContent,
sticky: true,
actions: {
primary: [{
id: 'void.goToChat',
Expand Down Expand Up @@ -1500,9 +1486,9 @@ We only need to do it for files that were edited since `from`, ie files between
}
}, true)

// when change focused message idx, jump
if (messageIdx !== undefined)
this.jumpToCheckpointBeforeMessageIdx({ threadId, messageIdx, jumpToUserModified: true })
// // when change focused message idx, jump - do not jump back when click edit, too confusing.
// if (messageIdx !== undefined)
// this.jumpToCheckpointBeforeMessageIdx({ threadId, messageIdx, jumpToUserModified: true })
}

// set message.state
Expand Down
Loading