Skip to content

MAESTRO as Host

MAESTRO (package care) is MAGE’s reference host. It owns the conversation, the model connection, memory and approvals; MAGE only turns a task into a chain. MAESTRO never runs or saves a chain as a side effect of generating it.

MAESTRO does not install MAGE from PyPI. It pins git revisions of the development line in pyproject.toml ([tool.uv.sources]):

MAESTRO branchMAGE revisionWhat it is
feat/maestro-library (release 0.5.0 sources)6140b3b (5 Oct 2026)0.2.0 line: typed requests, runtime admission, IdeaL hints selected by the host, task-title chain names.
feat/dataset-studio (development, after 0.5.0)b7a6e27 (2 Nov 2026), branch maestro/step-field-refsThe commit above plus fixes from feat/v3-phase0: saved input contracts survive edit and repair, typed literal bindings, $steps.N.tool_name, estimated usage when a provider reports none, and an export fix (a field of a step result is $steps.N.result_data.<field>, not $history[N].<field>).

Both report version 0.2.0+ideal.20261005.1. Both run MAGEGenerator with legacy, the default strategy in those revisions. Neither revision has the v3 strategy: it ships only in the 0.2.0 candidate (prep/mage-0.2.0), which MAESTRO does not pin, so MAESTRO does not use v3. The memory loop and the forges are not in either revision. On the development branch of the desktop app the chat agent writes chains itself by default, so MAGE is not called at all unless you ask for it (see below).

MAESTRO’s dependency line still says mmar-mage>=0.1.4, a version that was never published, so MAESTRO installs only from a checkout where the git pins apply. It also overrides MAGE’s own CARL pin with a CARL revision of its own.

  • CLI and TUI: maestro generate and the TUI generate screen always use MAGE, with the [mage] settings (CARE_MAGE__*): endpoint, model, key, mode, research switches. See Generate, run and replay.
  • Desktop app, 0.5.0: the MAESTRO harness picks a strategy for each chain request. A new chain is usually generate_chain, which runs MAGE through the maestro_generate_chain tool (or as a background job). author_chain, where the chat agent writes CARL itself, is used when you ask for it.
  • Desktop app, development branch: the default flips. Setting defaults.chain_author (CARE_DEFAULTS__CHAIN_AUTHOR) is agent: the chat agent looks at real API responses, writes the chain, validates and test-runs it. With mage, or when you ask for MAGE, generation goes through MAGE as before. Not released.

MAGE builds its own OpenAI-compatible client from MAGEConfig. MAESTRO always sets provider="custom" and fills base_url, api_key, model:

  • CLI and TUI: from [mage].
  • Desktop app: from the chat session that asked for the chain, through the harness’s private chat-model bridge. MAGE gets a loopback URL and a short-lived proxy credential; the provider key stays in the harness. If a chain operation has no chat binding, it fails instead of falling back to the [mage] key. The bridge raises MAGE’s HTTP timeout to 300 s (capped by max_wall_time_seconds), because the proxy returns the whole response at once. On the development branch, defaults.chain_model = "custom" sends chain operations to the [mage] endpoint instead.

care/generation.py builds the MAGEConfig and a GenerationRequest:

InputHow MAESTRO fills it
MAGEConfigEvery field of [mage] that the installed MAGE declares (an unknown field is an error, not silently dropped); mode; provider="custom"; memory_base_url = MAESTRO’s Memory URL.
Memory switchesWith IdeaL as chain memory: enable_memory, enable_memory_research, enable_memory_skill_lookup off, because MAESTRO recalls itself.
Deployable chainsallowed_step_types without human_input: a deployed agent has nobody to answer.
current_taskThe safe task, without file bodies or private paths.
project_instructionsStanding user and project instructions.
FilesOne input_manifest entry per file (name, kind, type, size, hash, profile) and the body as private retrieved_untrusted_context.
Turn contextFollow-up text richer than the task, with inline attachments stripped, as private untrusted context.
Recalled contextMAESTRO’s recall of related chains, as untrusted context (gigaevo-recall or ideal-catalog). For IdeaL, the selected-context mode so the model sees only that item.
runtime_input_schemaThe chain’s input contract, when the plan has one.
Policiesexternal_research="safe_task_only", PersistencePolicy(mode="explicit_only"): MAGE saves nothing.
capabilitiesMAESTRO’s tool catalogue as a closed-world CapabilityContext.
cancel, progressEsc or the job’s cancel button; progress drives the UI.

See Typed requests and admission for what each field means to MAGE.

MAESTRO does not trust MAGE’s own validation as the last word:

  1. The chain is extracted from the result and the input schema is attached to its metadata.
  2. A deterministic check of web-search tool queries, with one provider-free repair.
  3. validate_runtime_chain() again, with the input schema, on the CARL that MAESTRO runs.
  4. Only then is the chain staged as a private artifact pinned by SHA-256, with a structure card and a readiness summary. Saving, running, deploying and evolving are separate actions with their own receipts and approvals.

Failures reach the chat as typed codes (provider_failed, generation_validation_failed, invalid_generation_result, chain_admission_failed) with a diagnostic, never as raw provider output.