feat(notes): truncate injected notes in system prompt to save tokens

This commit is contained in:
GH05TCREW
2025-12-13 08:40:02 -07:00
parent 42604b3f39
commit a3de1ab4b4
3 changed files with 7 additions and 0 deletions

View File

@@ -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}")

View File

@@ -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 %}

View File

@@ -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 %}