@@ -1506,8 +1506,11 @@ export class ChatWidget extends Disposable implements IChatWidget {
15061506 this . container . setAttribute ( 'data-session-id' , model . sessionId ) ;
15071507 this . viewModel = this . instantiationService . createInstance ( ChatViewModel , model , this . _codeBlockModelCollection ) ;
15081508
1509- // Apply any placeholder from the view model immediately
1510- if ( this . viewModel . inputPlaceholder ) {
1509+ if ( this . _lockedToCodingAgent ) {
1510+ const placeholder = localize ( 'chat.input.placeholder.lockedToAgent' , "Follow up with {0}" , this . _lockedToCodingAgent ) ;
1511+ this . viewModel . setInputPlaceholder ( placeholder ) ;
1512+ this . inputEditor . updateOptions ( { placeholder } ) ;
1513+ } else if ( this . viewModel . inputPlaceholder ) {
15111514 this . inputEditor . updateOptions ( { placeholder : this . viewModel . inputPlaceholder } ) ;
15121515 }
15131516
@@ -1610,22 +1613,12 @@ export class ChatWidget extends Disposable implements IChatWidget {
16101613 }
16111614
16121615 // Coding agent locking methods
1613- public lockToCodingAgent ( name : string ) : void {
1614- this . _lockedToCodingAgent = name ;
1616+ public lockToCodingAgent ( name : string , displayName : string ) : void {
1617+ this . _lockedToCodingAgent = displayName ;
16151618 this . _codingAgentPrefix = `@${ name } ` ;
16161619 this . _lockedToCodingAgentContextKey . set ( true ) ;
16171620 this . renderWelcomeViewContentIfNeeded ( ) ;
16181621 this . input . setChatMode ( ChatModeKind . Ask ) ;
1619-
1620- // Update the placeholder to show that we're locked to this agent
1621- const localized = localize ( 'chat.input.placeholder.lockedToAgent' , "Chat with @{0}" , name ) ;
1622- if ( this . viewModel ) {
1623- this . viewModel . setInputPlaceholder ( localized ) ;
1624- }
1625- this . inputEditor . updateOptions ( { placeholder : localized } ) ;
1626-
1627- this . renderer . updateOptions ( { restorable : false , editable : false } ) ;
1628- this . tree . rerender ( ) ;
16291622 }
16301623
16311624 public unlockFromCodingAgent ( ) : void {
@@ -1641,8 +1634,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
16411634 if ( this . viewModel ) {
16421635 this . viewModel . resetInputPlaceholder ( ) ;
16431636 }
1644-
1645- // Also clear the editor's placeholder immediately for immediate visual feedback
16461637 this . inputEditor . updateOptions ( { placeholder : undefined } ) ;
16471638 this . renderer . updateOptions ( { restorable : true , editable : true } ) ;
16481639 this . tree . rerender ( ) ;
@@ -1687,11 +1678,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
16871678 }
16881679 } ) ;
16891680
1690- // Save the locked coding agent state
1691- if ( this . _lockedToCodingAgent ) {
1692- inputState . lockedToCodingAgent = this . _lockedToCodingAgent ;
1693- }
1694-
16951681 return inputState ;
16961682 }
16971683
@@ -2100,12 +2086,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
21002086 getViewState ( ) : IChatViewState {
21012087 // Get the input state which includes our locked agent (if any)
21022088 const inputState = this . input . getViewState ( ) ;
2103-
2104- // Ensure the locked agent state is included
2105- if ( this . _lockedToCodingAgent && inputState && ! inputState . lockedToCodingAgent ) {
2106- inputState . lockedToCodingAgent = this . _lockedToCodingAgent ;
2107- }
2108-
21092089 return {
21102090 inputValue : this . getInput ( ) ,
21112091 inputState : inputState
0 commit comments