一键导入
exact-rendered-decision-journaling
Journal each per-message tool result replacement so resume logic replays the exact preview the model saw.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Journal each per-message tool result replacement so resume logic replays the exact preview the model saw.
用 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 | exact-rendered-decision-journaling |
| description | Journal each per-message tool result replacement so resume logic replays the exact preview the model saw. |
| metadata | {"author":"ychampion"} |
Domain: tool-orchestration
Trigger: Apply whenever per-message budgeting rewrites tool_result content so transcripts capture the preview string and resume logic can reapply the same decisions.
Source Pattern: Distilled from reviewed tool-loop and result-shaping patterns.
After enforceToolResultBudget persists a candidate, produce a ToolResultReplacementRecord (kind: 'tool-result', toolUseId, replacement) that stores the literal preview returned by buildLargeToolResultMessage. Pass newlyReplaced to the writeToTranscript callback so every replacement is serialized in the conversation transcript; later, reconstructContentReplacementState(messages, records, inheritedReplacements) can rebuild the same seenIds/replacements map, and provisionContentReplacementState gates the feature flag (tengu_hawthorn_steeple) so journaling stays optional.
toolUseId with each record so resume enforcement can quickly look up replacements without re-running persistence.parentState.replacements into reconstructForSubagentResume when resuming forks so inherited decisions reapply exactly.writeToTranscript; it may be undefined in ephemeral contexts, so only call it when provided.provisionContentReplacementState should return undefined and journaling remains inert.In the query loop pass the transcript writer to applyToolResultBudget; the callback serializes newlyReplaced records, which are later replayed by provisionContentReplacementState(initialMessages, records) during resume so the budget enforces the same replacements it originally made.
persistToolResult succeeds and the preview is built—the replacement string must exist before you write it down.kind: 'tool-result' or the toolUseId fields; reconstructContentReplacementState relies on them to filter and lookup.