What is Context?
Context is a list of messages that tracks conversation history. Each message has a role (user, assistant, tool, system) and content.
Messages
Four message types:Context Types
A1 uses three context types:main: Clean successful execution history (user inputs + outputs)attempt_*: Code generation/execution attempts (e.g.,attempt_a,attempt_b)intermediate_*: LLM calls from within generated code (e.g.,intermediate_a)
When Messages Are Added
During JIT execution:- User input added to
mainat start - Assistant output added to
mainat end - Tool calls added to
mainduring execution
- Nothing added to
maincontext - Compilation attempts tracked in
attempt_*contexts - Each candidate gets its own attempt context
- Same as regular tool execution
- Nothing added to
maincontext (it’s just a tool)
Runtime
Runtime manages all contexts for a session:- Context lifecycle (creation, cleanup)
- Named contexts (
main,attempt_a,intermediate_a, etc.) - Context isolation between sessions