feat: launch Relayflow agents from personas

Merged
KH
4mo ago
+1318-59

Summary

  • let Relayflow agent definitions use persona in place of cli + role, in YAML and the TypeScript builder
  • resolve ids and JSON paths through @agentworkforce/persona-registry, then prepare skills, MCP servers, sidecars, harness settings, model, and isolated autosync mount through persona-kit in process
  • layer each workflow step task over the persona's standing instructions
  • require broker worker_ready plus authoritative agent inventory before continuing, releasing the worker and disposing its prepared runtime on any failure
  • keep raw CLI and non-interactive process paths explicit and type-safe

This is the Relayflows part of https://github.com/AgentWorkforce/workforce/issues/306. It does not shell out to agentworkforce.

Verification

  • primitive builds — exit 0
  • core TypeScript check — exit 0
  • persona runtime, builder, and workflow-runner tests — 79 passed
  • full core suite — not passing: 805 passed and 8 baseline run-script tests failed because this checkout has no tsx binary and their npx tsx fallback exited 127
  • staged whitespace, secret-pattern, and home-path scans — 0 findings

Stack / blockers

Depends on AgentWorkforce/workforce#307 and the subsequent Workforce 4.1.38+ publication. @agentworkforce/persona-registry and the persona-kit autosync contract are not published yet, so a clean install/lock refresh is intentionally blocked until that upstream release; the local validation used the checked-out Workforce packages.


Summary by cubic

Launch Relayflow agents directly from AgentWorkforce personas to simplify config and run with the persona’s harness, model, and settings. Adds strict schema and template validation, and waits for runtime readiness and broker registration before executing steps.

  • New Features

    • Add persona to agent config and builder (agent('name', { persona: 'id' })) as an alternative to cli. Resolve and activate personas via @agentworkforce/persona-registry and @agentworkforce/persona-kit, installing skills and launching in an isolated autosync mount; layer workflow tasks over standing instructions.
    • Wait for broker worker_ready, verify registration via inventory, then proceed; dispose the persona runtime and release the worker on failure.
    • Validation and guardrails across YAML/schema/templates: require exactly one of cli or persona; persona agents are interactive-only and cannot set role, preset, or constraints.model; template loader rejects malformed cli/persona values; persona agents are blocked from non-interactive paths (process backend, diagnostics).
  • Migration

    • YAML: use persona: <id> instead of cli/role; do not combine with cli, role, or preset; do not set constraints.model; personas must be interactive (do not use interactive: false).
    • Requires Workforce 4.1.38+ (@agentworkforce/persona-kit, @agentworkforce/persona-registry).