Skip to content

Commit f9eaabb

Browse files
authored
Update cli.py
1 parent 721ef96 commit f9eaabb

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

python_agent_harness/cli.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@ def make_session(
9191
# (same precedence as the main agent's stream).
9292
effective_stream = settings["stream"] if stream is None else stream
9393
model_profiles = config.load_models_config(config_path)
94+
default_agent = config.load_default_agent(config_path)
9495
# Base settings for /model switching: the main llm settings as
9596
# resolved at session start (incl. the CLI --model/--no-stream
9697
# overrides above), so a profile's unset keys inherit these
9798
# instead of values drifted by earlier switches.
9899
llm_settings = dict(settings)
99100
llm_settings["stream"] = effective_stream
100-
return Session(
101+
session = Session(
101102
project_dir=abs_project,
102103
client=client,
103104
model=model,
@@ -117,9 +118,13 @@ def make_session(
117118
skill_path=paths.get("skill_path"),
118119
mcp=mcp_config,
119120
model_profiles=model_profiles,
121+
default_agent=default_agent,
120122
llm_settings=llm_settings,
121123
config_path=config_path,
122124
)
125+
if default_agent and default_agent != "default":
126+
session.switch_agent(default_agent)
127+
return session
123128

124129

125130
def make_session_with_mcp(
@@ -228,6 +233,9 @@ def cmd_config(args: argparse.Namespace) -> int:
228233
print(f" {pattern}: {size}")
229234
else:
230235
print("context_windows: (none configured — built-in table in config.py applies)")
236+
# Show default agent
237+
default_agent = config.load_default_agent(args.path)
238+
print(f"default_agent: {default_agent or '(default: agent.md)'}")
231239
return 0
232240

233241

0 commit comments

Comments
 (0)