一键导入
nested-memory-trigger-consume-and-clear
Process every nested-memory trigger before wiping the trigger set so subsequent iterations only see new paths.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Process every nested-memory trigger before wiping the trigger set so subsequent iterations only see new paths.
用 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 | nested-memory-trigger-consume-and-clear |
| description | Process every nested-memory trigger before wiping the trigger set so subsequent iterations only see new paths. |
| metadata | {"author":"ychampion"} |
Domain: context-management
Trigger: Apply when a worker must fetch nested memory attachments whose trigger list can be cleared only after all paths are handled.
Source Pattern: Distilled from reviewed context, compaction, and memory-governance patterns.
Treat the trigger set as authoritative input, not a mutable queue that shrinks mid-processing. First return with an empty list if no triggers exist so render-bound helpers like getAppState() never run unnecessarily. Once you know work is required, snapshot the triggers, iterate over every path to gather nested attachments holding onto shared app state, append all results to the response, and only after the loop completes clear the trigger set. This prevents stale triggers from re-running in future turns while ensuring concurrent iterations do not drop paths that were just discovered.
getAppState() call with an early return whenever nestedMemoryAttachmentTriggers is empty.appState object to avoid repeated renders.When multiple nested memories are queued while a thread is still running, fetch them all inside a single getNestedMemoryAttachments call, clear the triggers afterward, and then hand the flattened attachment list to the caller.
getAppState() when there are no triggers, which wastes React render cycles.