11#!/usr/bin/env python3
22import json
3+ import os
34import sys
45import time
56
1011from iclaw .commands .search_provider import handle_search_provider_command
1112from iclaw .commands .utils import handle_copy_command
1213from iclaw .completer import IclawCompleter
13- from iclaw .config import CONFIG_PATH , TOKEN_REFRESH_INTERVAL , load_github_token
14+ from iclaw .config import (
15+ CONFIG_PATH ,
16+ TOKEN_REFRESH_INTERVAL ,
17+ load_github_token ,
18+ load_session_settings ,
19+ save_session_settings ,
20+ )
1421from iclaw .exec_tool import exec_command as exec
1522from iclaw .github_api import chat , get_copilot_token
1623from iclaw .tools .defs import TOOLS
2229 ("/model" , "Select specific model from your provider" ),
2330 ("/search_provider" , "Select the web search provider" ),
2431 ("/copy" , "Copy last Copilot response to clipboard" ),
32+ ("/status" , "Show current settings" ),
2533 ("/help" , "Show available commands" ),
2634 (".exit" , "Quit" ),
2735]
@@ -32,9 +40,10 @@ def main():
3240 copilot_token = None
3341 token_expiry = 0
3442 last_reply = None
35- search_provider = "duckduckgo"
36- model_provider = "copilot"
37- current_model = "gpt-5.2"
43+ settings = load_session_settings ()
44+ model_provider = settings ["model_provider" ]
45+ current_model = settings ["current_model" ]
46+ search_provider = settings ["search_provider" ]
3847
3948 if github_token :
4049 print ("Connecting to GitHub Copilot..." )
@@ -82,12 +91,22 @@ def main():
8291 copilot_token = t
8392 github_token = load_github_token ()
8493 token_expiry = time .monotonic () + TOKEN_REFRESH_INTERVAL
94+ save_session_settings (model_provider , current_model , search_provider )
8595 continue
8696 if user_input == "/model" :
8797 current_model = handle_model_command (copilot_token , current_model )
98+ save_session_settings (model_provider , current_model , search_provider )
8899 continue
89100 if user_input == "/search_provider" :
90101 search_provider = handle_search_provider_command (search_provider )
102+ save_session_settings (model_provider , current_model , search_provider )
103+ continue
104+ if user_input == "/status" :
105+ print (f" model_provider: { model_provider } " )
106+ print (f" model: { current_model } " )
107+ print (f" search_provider: { search_provider } " )
108+ print (f" cwd: { os .getcwd ()} " )
109+ print ()
91110 continue
92111
93112 if not copilot_token :
0 commit comments