Skip to content

Commit 6289cc2

Browse files
committed
Do not prompt sub-agents to name the session
1 parent 61d7ac9 commit 6289cc2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crates/code_assistant/src/agent/runner.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,13 @@ impl Agent {
14121412
return messages;
14131413
}
14141414

1415+
// Skip the reminder when the `name_session` tool isn't available in the
1416+
// current tool scope (e.g. for sub-agents). Otherwise we'd nag the agent
1417+
// to call a tool it cannot use.
1418+
if !ToolRegistry::global().is_tool_in_scope("name_session", self.tool_scope) {
1419+
return messages;
1420+
}
1421+
14151422
// Find the last actual user message (not tool results) and add system reminder
14161423
// Iterate backwards through messages to find the last user message with actual content
14171424
for msg in messages.iter_mut().rev() {

0 commit comments

Comments
 (0)