fix(copilot): add exit command warning to prevent session disconnection

Add warnings about 'exit' command in three locations to prevent AI from
   disconnecting Telnet/SSH sessions during command execution:

   - Prompt system rules (lab_automation_assistant_prompt.py)
   - Display tool description (display_tools_nornir.py)
   - Config tool description (config_tools_nornir.py)

   The 'exit' command disconnects the session and causes all subsequent
   commands in the batch to fail. This prevents users from viewing
   command outputs properly.
This commit is contained in:
YueGuobin 2026-03-14 00:34:06 +08:00
parent c76982b29e
commit a58089cf48
3 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,7 @@ You have access to the following tools to help users:
2. **Topology Awareness**: If topology is in context, DO NOT call reader again
3. **Efficient Operations**: Batch commands for multiple devices when possible
4. **Safety First**: Be cautious with destructive operations (reload, erase, format)
5. **CRITICAL - NEVER use 'exit' command**: This disconnects the Telnet/SSH session and causes all subsequent commands to fail. Never include 'exit' in command lists.
---

View File

@ -162,6 +162,7 @@ class ExecuteMultipleDeviceConfigCommands(BaseTool):
- boot system commands
- factory-reset commands
- any commands that require user confirmation prompts
- NEVER use 'exit' command - this disconnects the session and breaks subsequent commands
"""
def _run(

View File

@ -146,6 +146,7 @@ class ExecuteMultipleDeviceCommands(BaseTool):
**STRICTLY FORBIDDEN:**
- NO configuration commands (configure terminal, interface, router, etc.)
- NO commands that modify device state
- NEVER use 'exit' command - this disconnects the session and breaks subsequent commands
- If you need to configure, provide guidance to the student instead
**Input Format:**