Skip to content

Add size caps to debug prompt logger hook#1902

Merged
siddseethepalli merged 1 commit into
mainfrom
swarm/task-5
Feb 14, 2026
Merged

Add size caps to debug prompt logger hook#1902
siddseethepalli merged 1 commit into
mainfrom
swarm/task-5

Conversation

@siddseethepalli
Copy link
Copy Markdown
Contributor

@siddseethepalli siddseethepalli commented Feb 14, 2026

Summary

  • Adds per-field truncation (2000 chars) for text, tool_use input, and tool_result content in the debug prompt logger
  • Caps system prompt output at 5000 chars
  • Caps the jq-less fallback path at 200KB total output
  • All messages are still shown (not limited to last 10) — only oversized individual fields are truncated
  • Image/file base64 data remains capped at 1000 chars (unchanged from Truncate base64 image/file data in debug prompt logger #1865)

Addresses codex review feedback on #1861: runHookScript buffers all hook stderr in memory and pre-llm-call hooks are awaited, so unbounded output from large conversations could cause large allocations and pre-call delays.

Test plan

  • Run with VELLUM_DEBUG=1 in a long conversation and verify output is bounded
  • Verify short messages appear in full (no unnecessary truncation)
  • Verify truncated fields show …[truncated] marker

Generated with Claude Code


Open with Devin

Per-field truncation (2000 chars for text/tool content, 1000 for
base64 image/file data) bounds individual message output. System
prompt is capped at 5000 chars. The jq-less fallback path is capped
at 200KB total. All messages are still shown — only oversized fields
are truncated.

Addresses review feedback on PR #1861.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment thread assistant/hook-templates/debug-prompt-logger/run.sh
@siddseethepalli
Copy link
Copy Markdown
Contributor Author

Addressed in #1907

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