Skip to content

fix(exa-agent): reduce SKILL.md size to avoid prompt truncation - #442

Open
phuongddx wants to merge 1 commit into
exa-labs:mainfrom
phuongddx:fix/exa-agent-skill-context-size
Open

phuongddx wants to merge 1 commit into
exa-labs:mainfrom
phuongddx:fix/exa-agent-skill-context-size

Conversation

@phuongddx

Copy link
Copy Markdown

Problem

skills/exa-agent/SKILL.md is 260 lines / 9.3KB (~2.5K tokens). Agent hosts that inject skills into the main prompt context have per-skill budgets (~2.3K tokens); this file overflows and gets truncated mid-file, silently dropping the end of Batch Script Mode and the entire Failure handling section — exactly the guidance needed when runs misbehave.

Observed in the wild (Codex plugin cache, exa plugin v3.4.1):

⚠ Skill exa:exa-agent exceeded the main prompt context limit and was truncated.

Fix

Condense to 81 lines / 5.2KB (~1.4K tokens) — fits with ~900 tokens of headroom. No behavioral content lost; only redundancy:

Change Before After
JSON schema examples 2 full examples (80 lines) 1 minimal example (25 lines)
Batch Script Mode separate section, duplicated Decision tree branch 1 verbatim folded into Decision tree branch 1
Continuation patterns separate section + repeated in workflow + failure handling folded into Workflow step 4
Exhaustiveness language separate 27-line section + repeated in workflow folded into Workflow step 5
Provider list named in description AND full body list kept (trigger matching preserved)

Preserved verbatim-in-substance: all 7 Exa Connect providers, request-only-provider warning, decision tree, pre-run checklist, outputSchema rules (maxItems, stable identifiers, formats), ZDR/~750s streaming note, runId/previousRunId continuation rules, input.data/input.exclusion, output.structured/output.grounding, coverage validation, exhaustive-claims guardrails, all four failure-handling modes.

Verification

  • Frontmatter parses; trigger keywords intact
  • JSON schema example validates (json.loads)
  • 31/31 key concepts grep-checked against original
  • Diff is single file, 32 insertions / 211 deletions
  • ~44% byte reduction, ~69% line reduction

Notes

  • Sibling skills/search/SKILL.md (14.3KB) has the same overflow risk — happy to do a follow-up if this approach is accepted.
  • Audit report available on request.

The exa-agent skill (260 lines / 9.3KB / ~2.5K tokens) exceeded agent
skill-injection budgets, causing hosts to truncate it mid-file — silently
dropping Batch Script Mode and Failure handling guidance.

Condense to 81 lines / 5.2KB (~1.4K tokens) without losing any behavioral
content:

- Replace two full JSON schema examples with one minimal example
- Fold Batch Script Mode into Decision tree branch 1 (was duplicated)
- Fold Continuation patterns into Workflow step 4 (was triplicated)
- Fold Exhaustiveness language into Workflow step 5 (was triplicated)
- Keep all 7 Exa Connect providers, ZDR notes, failure handling,
  outputSchema rules, coverage-validation steps, and trigger keywords

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant