Skip to main content

synth_ai.data.coding_agent_context

Context override data models for coding agent optimization. These models define context overrides used by unified optimization (GEPA) to modify the agent’s runtime environment alongside system prompts. Includes file artifacts, preflight scripts, environment variables, and application status reporting.

Classes

OverrideType

Type of context override target.

OverrideOperation

Operation to apply for an override.

FolderMode

How to handle folder overrides.

ApplicationStatus

Status of override application by task app.

ApplicationErrorType

Classification of override application error.

ContextOverride

Context override for unified optimization. Represents modifications to the agent’s runtime environment that can be optimized alongside the system prompt. Includes:
  • file_artifacts: Files to write to agent workspace (e.g., AGENTS.md, skills/*.yaml)
  • preflight_script: Bash script to run before agent execution
  • env_vars: Environment variables to set
Example:
    override = ContextOverride(
        file_artifacts={"AGENTS.md": "# Guidelines
…”, “.codex/skills.yaml”: “style: verbosity: concise”}, preflight_script=”#!/bin/bash echo ‘Setup complete’”, env_vars={“STRATEGY”: “test_first”}, mutation_type=“multi” ) Note: File artifact paths are relative to the task app workspace. Agent-specific paths such as .codex/skills.yaml or .opencode/skills.yaml are resolved by the task app based on the agent type. Warning: Task apps enforce size limits on files, scripts, and env vars. Large overrides may be rejected at application time. Methods:

is_empty

is_empty(self) -> bool
Check if this override has no actual content. Returns:
  • True if file_artifacts, preflight_script, and env_vars are all empty.

size_bytes

size_bytes(self) -> int
Calculate total size of override content in bytes. Returns:
  • Total UTF-8 encoded size of files, script, and env vars.

to_dict

to_dict(self) -> Dict[str, Any]
Convert to dict for serialization. Returns:
  • Dict with only populated fields for compact payloads.

OverrideApplicationError

Error details for a failed override application.

ContextOverrideStatus

Status of context override application by task app. Reports per-target application results so GEPA can learn from failures. Methods:

to_dict

to_dict(self) -> Dict[str, Any]
Convert to dict for serialization. Returns:
  • Dict with only populated fields for compact payloads.