@@ -16,6 +16,7 @@ import { Preset } from '@shared/types/preset'
1616import { ConfigPresetFormat } from '@/views/panel/backend/utils/preset-format-converters'
1717import { LAST_SELECTED_BROWSER_ID_STATE_KEY } from '@/constants/state-keys'
1818import { ApplyChatResponseCommandArgs } from '@/commands/apply-chat-response-command/response-processor'
19+ import { WebPromptType } from '@shared/types/prompt-types'
1920
2021/**
2122 * Bridges the current workspace window and websocket server that runs in a separate process.
@@ -315,7 +316,7 @@ export class WebSocketManager {
315316 preset_name : string
316317 raw_instructions ?: string
317318 edit_format ?: string
318- prompt_type : any
319+ prompt_type ?: WebPromptType
319320 } >
320321 presets_config_key : string
321322 } ) : Promise < boolean > {
@@ -328,6 +329,7 @@ export class WebSocketManager {
328329 config . get < ConfigPresetFormat [ ] > ( params . presets_config_key ) ?? [ ]
329330 const gemini_user_id = config . get < number | null > ( 'geminiUserId' )
330331 const ai_studio_user_id = config . get < number | null > ( 'aiStudioUserId' )
332+ const reuse_last_tab = config . get < boolean > ( 'reuseLastTab' , false )
331333
332334 const target_browser_id = await this . _select_browser ( )
333335 if ( target_browser_id === undefined ) {
@@ -405,7 +407,8 @@ export class WebSocketManager {
405407 client_id : this . client_id || 0 , // 0 is a temporary fallback and should be removed few weeks from 28.03.25
406408 raw_instructions : chat . raw_instructions ,
407409 edit_format : chat . edit_format ,
408- prompt_type : chat . prompt_type
410+ prompt_type : chat . prompt_type ,
411+ reuse_last_tab
409412 }
410413
411414 Logger . info ( {
@@ -424,7 +427,7 @@ export class WebSocketManager {
424427 instruction : string
425428 preset : Preset
426429 raw_instructions : string
427- prompt_type : any
430+ prompt_type ?: WebPromptType
428431 } ) : Promise < boolean > {
429432 if ( ! this . has_connected_browsers ) {
430433 throw new Error ( 'Does not have connected browsers.' )
@@ -438,6 +441,7 @@ export class WebSocketManager {
438441 const config = vscode . workspace . getConfiguration ( 'codeWebChat' )
439442 const gemini_user_number = config . get < number | null > ( 'geminiUserNumber' )
440443 const ai_studio_user_id = config . get < number | null > ( 'aiStudioUserId' )
444+ const reuse_last_tab = config . get < boolean > ( 'reuseLastTab' , false )
441445
442446 const chatbot = CHATBOTS [ params . preset . chatbot as keyof typeof CHATBOTS ]
443447 let url : string
@@ -507,7 +511,8 @@ export class WebSocketManager {
507511 options : params . preset . options ,
508512 client_id : this . client_id || 0 , // 0 is a temporary fallback and should be removed few weeks from 28.03.25
509513 raw_instructions : params . raw_instructions ,
510- prompt_type : params . prompt_type
514+ prompt_type : params . prompt_type ,
515+ reuse_last_tab
511516 }
512517
513518 Logger . info ( {
0 commit comments