You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Structured Terminal Context:
- Parse raw terminal buffer into hostname, prompt, and last 5 command/output pairs
- Send structured context to AI instead of raw text dump
- Hostname extracted from Cisco/Linux/Junos/MikroTik/FortiGate prompt patterns
2. Auto Device Detection:
- When deviceType='auto', detect from terminal output before sending to AI
- Uses existing deviceDetector rules against live terminal buffer
- Falls back to 'generic' if detection fails
3. Multi-command batch tool (run_commands):
- New tool that executes 2-5 commands sequentially, returns all results at once
- Saves round-trips vs individual run_command calls
- AI instructed to prefer batch when commands are independent
4. Retry with better context:
- When a read-only command returns empty/minimal output, append a system note
- Hints AI about possible causes (wrong syntax for device, pager, etc.)
- AI can then retry with vendor-appropriate command variant
5. Conversation compression:
- Replace naive trim (drop middle messages) with smart compression
- Summarizes middle messages into a compact block
- Always preserves first message (intent) and last 30 messages (recent context)
'Execute 2-5 commands sequentially on a device and return ALL results at once. '+
97
+
'Use this instead of multiple run_command calls when commands are independent (e.g. "show ip bgp summary" + "show ip route summary" + "show interfaces brief"). '+
98
+
'Each command runs after the previous finishes. All outputs are collected and returned together. '+
99
+
'This saves round-trips and is faster than calling run_command multiple times.',
100
+
input_schema: {
101
+
type: 'object'asconst,
102
+
properties: {
103
+
commands: {
104
+
type: 'array',
105
+
items: {
106
+
type: 'object',
107
+
properties: {
108
+
command: {type: 'string',description: 'Command to execute'},
109
+
reason: {type: 'string',description: 'Why this command is needed'},
110
+
},
111
+
required: ['command','reason'],
112
+
},
113
+
minItems: 2,
114
+
maxItems: 5,
115
+
description: 'Array of commands to execute in order',
116
+
},
117
+
target_session: {type: 'string',description: 'Session ID. Omit for active session.'},
118
+
},
119
+
required: ['commands'],
120
+
},
121
+
}
122
+
92
123
// ── System prompt builder ────────────────────────────────────────────────────
content: `${output}\n\n[SYSTEM NOTE: Command returned minimal/no output. Possible causes: (1) command syntax wrong for this device type, (2) device is still processing, (3) pager ate the output. Consider retrying with a vendor-appropriate variant of the command, or add a pipe filter.]`,
0 commit comments