Skip to content

Record full Platform AgentRuntime lifecycle for Maestro turns, steps, and waits #170

Description

@haasonsaas

Summary

Maestro has an optional Platform AgentRuntime client, but the current integration is still too shallow: it mainly records a session-start trigger and treats Platform failures as non-blocking fallback. The next step is to make Platform's AgentRuntime the durable spine for Maestro turns, steps, waits, resumes, and terminal state while preserving local/offline behavior.

Why it matters

Without this, Platform cannot reliably join Maestro sessions to ToolExecution, approvals, timeline, meter, audit, prompt/skill outcomes, or hosted runner sessions. The event bus can say something happened, but AgentRuntime should answer what run it belonged to, which step it happened inside, whether it paused, and how it resumed.

This is the concrete implementation slice under the broader ledger tracker.

What to build

  • Expand the Platform AgentRuntime client from session-start recording into turn/step lifecycle recording.
  • Create or attach a stable AgentRun for each Platform-backed Maestro session.
  • Record user turn, model turn, tool step, wait, resume, completion, cancellation, and failure states with stable ids.
  • Map Maestro approval pauses and human-in-the-loop decisions to Platform wait/resume semantics instead of synthetic chat-only continuation.
  • Propagate agent_run_id and agent_run_step_id into Maestro CloudEvents, ToolExecution bridge metadata, meter/audit context, and hosted/headless protocol output where relevant.
  • Keep local/offline Maestro behavior unchanged when Platform env/config is absent or disabled.

Acceptance criteria

  • A mocked Platform-backed smoke path starts a Maestro session, records at least one turn step, records one tool step, pauses on an approval wait, resumes, and completes/fails the AgentRun.
  • Existing local sessions still work without Platform configuration.
  • Platform unavailable/malformed responses have explicit fallback behavior and tests.
  • Event-bus and ToolExecution payloads carry the same run/step correlation ids.
  • Docs/env examples explain the feature flag, failure mode, and identity/correlation fields.

Related: #72, #73, evalops/platform#780, evalops/platform#915, evalops/platform#765.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architecture-reviewCross-service architecture review requestedenhancementNew feature or request

    Type

    No type

    Fields

    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