一键导入
empty-payload-sentinel-guard
Guard requests from closing instantly when a tool returns nothing by injecting the sentinel message and logging the event.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guard requests from closing instantly when a tool returns nothing by injecting the sentinel message and logging the event.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Collapse multiple change sources into one caller-facing boolean so headless bootstraps know whether a downstream refresh is necessary.
After awaiting persistence work, update the shared budget state for each `tool_use_id` exactly once so no concurrent reader ever sees a half-committed decision.
Issue continuation nudges while the turn stays under budget, then halt once diminishing returns or the budget cap justify stopping.
Lazily extract referenced files for bundled skills so large prompts stay offline until needed.
Persist a cache-safe stop-hook context snapshot only for main session queries so later helpers can resume from stable state without fork pollution.
Sweep stale extension caches before activation, then fall back to a sticky manual-refresh flag if the live refresh fails.
| name | empty-payload-sentinel-guard |
| description | Guard requests from closing instantly when a tool returns nothing by injecting the sentinel message and logging the event. |
| metadata | {"author":"ychampion"} |
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.
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.
isToolResultContentEmpty so structured arrays and whitespace-only strings are treated identically.sanitizeToolNameForAnalytics before logging so GrowthBook metrics stay consistent.content; leave tool_use_id, tool_version, and other metadata untouched.({toolName} completed with no output) message.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.