session.syncshot()
Manually regenerate a local Session system from the Agent's current configuration
session.syncshot()
A local Session fixes its system in memory after the first generation. To explicitly adopt the Agent's latest instruction, managed system blocks, and plugin system text, call:
await session.syncshot();syncshot() replaces the Session's in-memory system snapshot. A provider request already in flight is unaffected; later steps use the new system. It refreshes only the system and does not change the Session's plugin execution view.
Persistence depends on whether the Session already has an instruction.md file:
- Existing file: atomically overwritten with the regenerated complete system.
- Missing file: only memory is updated; no file is created automatically.
To create instruction.md for the first time, explicitly persist after refreshing:
await session.syncshot();
await session.snapshot();syncshot() and snapshot() run serially within one Session so concurrent writes have deterministic ordering. This method is available only on local AgentSession; remote Sessions do not expose it.