mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-03-07 22:33:38 +00:00
feat(notes): truncate injected notes in system prompt to save tokens
This commit is contained in:
@@ -82,6 +82,11 @@ class GhostCrewAgent(BaseAgent):
|
||||
cat = data.get("category", "info")
|
||||
content = data.get("content", "")
|
||||
|
||||
# Truncate long notes in system prompt to save tokens
|
||||
# The agent can use the 'read' tool to get the full content
|
||||
if len(content) > 200:
|
||||
content = content[:197] + "..."
|
||||
|
||||
if cat not in grouped:
|
||||
grouped[cat] = []
|
||||
grouped[cat].append(f"- {key}: {content}")
|
||||
|
||||
@@ -60,5 +60,6 @@ Scope: {{ scope | join(', ') }}
|
||||
|
||||
{% if notes_context %}
|
||||
## Saved Notes (from previous tasks)
|
||||
(Notes may be truncated. Use `notes(action='read', key='...')` to see full content if needed.)
|
||||
{{ notes_context }}
|
||||
{% endif %}
|
||||
|
||||
@@ -44,5 +44,6 @@ Scope: {{ scope | join(', ') }}
|
||||
|
||||
{% if notes_context %}
|
||||
## Saved Notes (from previous tasks)
|
||||
(Notes may be truncated. Use `notes(action='read', key='...')` to see full content if needed.)
|
||||
{{ notes_context }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user