@@ -616,6 +616,7 @@ export default function ChatView(props: ChatViewProps) {
616616 ( store ) => store . setStickyModelSelection ,
617617 ) ;
618618 const timestampFormat = settings . timestampFormat ;
619+ const autoOpenPlanSidebar = settings . autoOpenPlanSidebar ;
619620 const navigate = useNavigate ( ) ;
620621 const rawSearch = useSearch ( {
621622 strict : false ,
@@ -2010,6 +2011,7 @@ export default function ChatView(props: ChatViewProps) {
20102011 planSidebarOpenOnNextThreadRef . current = false ;
20112012 setPlanSidebarOpen ( true ) ;
20122013 } else {
2014+ planSidebarOpenOnNextThreadRef . current = false ;
20132015 setPlanSidebarOpen ( false ) ;
20142016 }
20152017 planSidebarDismissedForTurnRef . current = null ;
@@ -2018,14 +2020,21 @@ export default function ChatView(props: ChatViewProps) {
20182020 // Auto-open the plan sidebar when plan/todo steps arrive for the current turn.
20192021 // Don't auto-open for plans carried over from a previous turn (the user can open manually).
20202022 useEffect ( ( ) => {
2023+ if ( ! autoOpenPlanSidebar ) return ;
20212024 if ( ! activePlan ) return ;
20222025 if ( planSidebarOpen ) return ;
20232026 const latestTurnId = activeLatestTurn ?. turnId ?? null ;
20242027 if ( latestTurnId && activePlan . turnId !== latestTurnId ) return ;
20252028 const turnKey = activePlan . turnId ?? sidebarProposedPlan ?. turnId ?? "__dismissed__" ;
20262029 if ( planSidebarDismissedForTurnRef . current === turnKey ) return ;
20272030 setPlanSidebarOpen ( true ) ;
2028- } , [ activePlan , activeLatestTurn ?. turnId , planSidebarOpen , sidebarProposedPlan ?. turnId ] ) ;
2031+ } , [
2032+ activePlan ,
2033+ activeLatestTurn ?. turnId ,
2034+ autoOpenPlanSidebar ,
2035+ planSidebarOpen ,
2036+ sidebarProposedPlan ?. turnId ,
2037+ ] ) ;
20292038
20302039 useEffect ( ( ) => {
20312040 setIsRevertingCheckpoint ( false ) ;
@@ -2950,7 +2959,7 @@ export default function ChatView(props: ChatViewProps) {
29502959 // Optimistically open the plan sidebar when implementing (not refining).
29512960 // "default" mode here means the agent is executing the plan, which produces
29522961 // step-tracking activities that the sidebar will display.
2953- if ( nextInteractionMode === "default" ) {
2962+ if ( nextInteractionMode === "default" && autoOpenPlanSidebar ) {
29542963 planSidebarDismissedForTurnRef . current = null ;
29552964 setPlanSidebarOpen ( true ) ;
29562965 }
@@ -2979,6 +2988,7 @@ export default function ChatView(props: ChatViewProps) {
29792988 runtimeMode ,
29802989 setComposerDraftInteractionMode ,
29812990 setThreadError ,
2991+ autoOpenPlanSidebar ,
29822992 environmentId ,
29832993 ] ,
29842994 ) ;
@@ -3071,8 +3081,8 @@ export default function ChatView(props: ChatViewProps) {
30713081 return waitForStartedServerThread ( scopeThreadRef ( activeThread . environmentId , nextThreadId ) ) ;
30723082 } )
30733083 . then ( ( ) => {
3074- // Signal that the plan sidebar should open on the new thread.
3075- planSidebarOpenOnNextThreadRef . current = true ;
3084+ // Signal that the plan sidebar should open on the new thread when enabled .
3085+ planSidebarOpenOnNextThreadRef . current = autoOpenPlanSidebar ;
30763086 return navigate ( {
30773087 to : "/$environmentId/$threadId" ,
30783088 params : {
@@ -3113,6 +3123,7 @@ export default function ChatView(props: ChatViewProps) {
31133123 navigate ,
31143124 resetLocalDispatch ,
31153125 runtimeMode ,
3126+ autoOpenPlanSidebar ,
31163127 environmentId ,
31173128 ] ) ;
31183129
0 commit comments