Empty payload sentinel guard

From ychampion/cskill-agents · View interactive version

Empty payload sentinel guard is an AI agent skill from the GitHub repository ychampion/cskill-agents. Guard requests from closing instantly when a tool returns nothing by injecting the sentinel message and logging the event.

How to use this skill

Skill file

SKILL: Empty Payload Sentinel Guard

Domain: tool-orchestration

Trigger: Apply this when a tool_result block might legitimately be empty (shell commands with no stdout, MCP commands returning content: [], statements that finish silently) so the assistant still sees something to react to.

Source Pattern: Distilled from reviewed tool-loop and result-shaping patterns.

Core Method

Run the same emptiness check used inside isToolResultContentEmpty: undefined/null, whitespace strings, empty arrays, or arrays whose text blocks are themselves empty count as empty. When the check fires, log tengu_tool_empty_result with the sanitized tool name and short-circuit the persistence path by returning the original block with content: "({toolName} completed with no output)", guaranteeing the model always sees at least one token even when the tool produced nothing.

Key Rules

Example Application

Invoke this guard inside maybePersistLargeToolResult before any size checks; if the guard fires, it returns the sentinel immediately and prevents the empty </function_results> tail from tricking Claude into ending the turn.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.