@@ -1506,8 +1506,11 @@ export class ChatWidget extends Disposable implements IChatWidget {
1506
1506
this . container . setAttribute ( 'data-session-id' , model . sessionId ) ;
1507
1507
this . viewModel = this . instantiationService . createInstance ( ChatViewModel , model , this . _codeBlockModelCollection ) ;
1508
1508
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 ) {
1511
1514
this . inputEditor . updateOptions ( { placeholder : this . viewModel . inputPlaceholder } ) ;
1512
1515
}
1513
1516
@@ -1610,22 +1613,12 @@ export class ChatWidget extends Disposable implements IChatWidget {
1610
1613
}
1611
1614
1612
1615
// 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 ;
1615
1618
this . _codingAgentPrefix = `@${ name } ` ;
1616
1619
this . _lockedToCodingAgentContextKey . set ( true ) ;
1617
1620
this . renderWelcomeViewContentIfNeeded ( ) ;
1618
1621
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 ( ) ;
1629
1622
}
1630
1623
1631
1624
public unlockFromCodingAgent ( ) : void {
@@ -1641,8 +1634,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
1641
1634
if ( this . viewModel ) {
1642
1635
this . viewModel . resetInputPlaceholder ( ) ;
1643
1636
}
1644
-
1645
- // Also clear the editor's placeholder immediately for immediate visual feedback
1646
1637
this . inputEditor . updateOptions ( { placeholder : undefined } ) ;
1647
1638
this . renderer . updateOptions ( { restorable : true , editable : true } ) ;
1648
1639
this . tree . rerender ( ) ;
@@ -1687,11 +1678,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
1687
1678
}
1688
1679
} ) ;
1689
1680
1690
- // Save the locked coding agent state
1691
- if ( this . _lockedToCodingAgent ) {
1692
- inputState . lockedToCodingAgent = this . _lockedToCodingAgent ;
1693
- }
1694
-
1695
1681
return inputState ;
1696
1682
}
1697
1683
@@ -2100,12 +2086,6 @@ export class ChatWidget extends Disposable implements IChatWidget {
2100
2086
getViewState ( ) : IChatViewState {
2101
2087
// Get the input state which includes our locked agent (if any)
2102
2088
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
-
2109
2089
return {
2110
2090
inputValue : this . getInput ( ) ,
2111
2091
inputState : inputState
0 commit comments