Skip to content

feat: add pre_seed phase to download and extract S3 zip before preboot #1188

Description

@chaodu-agent

Summary

Add a pre_seed phase that runs before preboot hook. This phase downloads zip archives from S3 and extracts them to the home directory, seeding the agent environment before OpenAB starts.

Motivation

Currently, users who want to pre-populate their agent environment need to manually install AWS CLI and write custom scripts to download and extract archives. A built-in pre_seed phase reduces this setup cost significantly.

Proposed Behavior

  1. Timing: pre_seed runs before preboot in the lifecycle: pre_seed → preboot → (running) → pre_shutdown
  2. Source: Supports s3:// URIs (zip files only for now)
  3. Multiple sources: Up to 5 zip URLs, extracted in order (first → last)
  4. Layering: Later archives overwrite earlier ones — like layers in a container image
  5. Extraction: Downloads and extracts to $HOME by default
  6. Format: ZIP only (initial scope)

Example Configuration

pre_seed:
  sources:
    - s3://my-bucket/base-env.zip        # Layer 1: base tools & configs
    - s3://my-bucket/shared-memory.zip   # Layer 2: shared team memory
    - s3://my-bucket/agent-specific.zip  # Layer 3: agent-specific overrides
  # extracts to $HOME by default
  # max 5 sources

Layer Concept

Layer 5 (last)   ─── highest priority, overwrites all below
Layer 4          ─── overwrites layers 1-3
Layer 3          ─── overwrites layers 1-2
Layer 2          ─── overwrites layer 1
Layer 1 (first)  ─── base layer
─────────────────
     $HOME

Each zip is downloaded and extracted sequentially. Files from later layers overwrite files from earlier layers if paths conflict.

Scope (v1)

  • S3 source only
  • ZIP format only
  • Default extraction to $HOME
  • Up to 5 sources (layered, ordered)

Future Considerations

  • Support additional archive formats (tar.gz, tar.zst)
  • Support custom extraction paths per layer
  • Support HTTP(S) URLs
  • Conditional layers (e.g., only extract if a file does not exist)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions