File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,6 +360,14 @@ def pop_todo_scope(self) -> None:
360360 self .todos = list (self ._todo_scopes [self ._todo_scope_stack [- 1 ]])
361361 self .notify ("todos" )
362362
363+ def clear_todos (self ) -> None :
364+ """Drop all todo scopes (e.g. session cleared or restored)."""
365+ self ._todo_scopes = {"main" : []}
366+ self ._todo_scope_stack = ["main" ]
367+ self ._todo_scope_labels = {}
368+ self .todos = []
369+ self .notify ("todos" )
370+
363371 def find_skill (self , name : str ) -> str | None :
364372 if not self ._skill_dir :
365373 return None
Original file line number Diff line number Diff line change @@ -849,6 +849,7 @@ def _handle_slash(self, line: str) -> bool:
849849 elif cmd == "/clear" :
850850 self .conversation_history = []
851851 self .session .last_messages = []
852+ self .session .clear_todos ()
852853 self .console .print ("[yellow]Conversation history cleared.[/yellow]" )
853854 elif cmd == "/help" :
854855 self .console .print (
@@ -1064,6 +1065,7 @@ def _run_restore(self, arg: str) -> None:
10641065 # Replace conversation history
10651066 self .conversation_history = messages
10661067 self .session .last_messages = list (messages )
1068+ self .session .clear_todos ()
10671069 self ._history_dirty = True
10681070 model = meta .get ("gptel-model" , "?" )
10691071 project = meta .get ("python-agent-harness--project-dir" , "?" )
You can’t perform that action at this time.
0 commit comments