Skip to main content

Module context_prefill

Module context_prefill 

Source
Expand description

Context prefill assembly for mana dispatch.

When imp run <unit_id> dispatches an agent, the unit description often references files the agent will need. Instead of making the agent spend turns reading those files, we assemble them into a cached prefix message that precedes the task prompt.

The assembled context gets cache_control breakpoints so every subsequent turn in the agent’s session gets cache_read on the file contents — no re-transmission cost.

Structs§

AssembledContext
Result of context assembly.
FileSpec
A file to include in the prefill context.
PrefillConfig
Configuration for context assembly.

Enums§

FileMode
How to extract content from a file.

Functions§

assemble_context
Assemble context from file specs, reading from disk and respecting budgets.
detect_file_paths
Auto-detect file paths from a unit description string.