mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-21 18:32:23 +03:00
fix: hint LLM about -c behavior when tshark returns empty with -c
This commit is contained in:
parent
09b0fbcfea
commit
b79fea918d
@ -447,6 +447,13 @@ class PacketAnalysisTool(BaseTool):
|
|||||||
logger.warning(f"tshark stderr: {result.stderr}")
|
logger.warning(f"tshark stderr: {result.stderr}")
|
||||||
|
|
||||||
if not output.strip():
|
if not output.strip():
|
||||||
|
if "-c" in tshark_args:
|
||||||
|
return json.dumps({
|
||||||
|
"error": "No matching packets found",
|
||||||
|
"hint": "The -c flag limits total packets READ, not matched results. "
|
||||||
|
"Try removing -c so tshark scans the entire capture file. "
|
||||||
|
'Use pipe to "head -N" to limit output instead.',
|
||||||
|
})
|
||||||
return "No matching packets found"
|
return "No matching packets found"
|
||||||
|
|
||||||
logger.info(f"tshark output: {len(output)} characters")
|
logger.info(f"tshark output: {len(output)} characters")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user