How background agents persist data and survive compaction
mainBackground agents solve the problem of context window exhaustion and compaction.
Persistence Mechanism:
- Results are saved to disk as markdown files in
~/.local/share/opencode/delegations/. - Each delegation is automatically tagged with a title and summary.
- When context is compacted, the AI can use
delegation_list()to scan past research anddelegation_read(id)to retrieve specific results from disk. - Data survives session restarts and process crashes.