Skip to content

orchestrate: adopt Trinity ephemeral (ghost) agents for disposable workers — replace durable eph-* deploy + best-effort teardown #3

Description

@vybe

Summary

The /orchestrate skill (agent-dev /add-orchestrator bundle) provisions disposable workers as durable agents named eph-<agent>-<short-id> via deploy_system, then tears them down best-effort with stop_agent + delete_agent — and deliberately skips teardown on failed runs, so a failed or interrupted orchestration leaves containers behind with no GC.

Trinity now ships first-class ephemeral agents (Abilityai/trinity#1580): create_agent accepts ephemeral: true plus a hard budget (max_executions and/or ttl_seconds), the platform hard-discards the agent at budget (container, DB rows, name — no soft-delete/retention), and a cleanup sweep reclaims orphans even after crashes. Spawn provenance auto-grants the parent→child permission edge, so the orchestrator can immediately chat with / control the child it spawned.

Acceptance Criteria

  • /orchestrate creates workers via create_agent with ephemeral: true and an explicit budget (max_executions sized to the planned runs, or a ttl_seconds window) instead of the durable eph-* + deploy_system path.
  • Parent control relies on the auto-granted spawn permission edge — no manual permission-grant step in the skill.
  • Teardown logic simplified: platform GC is the safety net; early discard via delete_agent when a worker finishes ahead of budget. No more skip-teardown-on-failure leak.
  • Graceful fallback: on 403 ephemeral_not_entitled (instance without the entitlement), fall back to the current durable eph-* flow with a one-time warning — the skill must keep working on OSS instances.
  • Failed-run inspection story documented: ghost execution rows are kept on discard and remain queryable via execution history (until standard retention); for interactive debugging, recommend a longer TTL rather than skipping teardown.
  • Plugin README / skill docs updated.

Technical Notes

  • Ephemeral creation intentionally skips credential auto-injection and defaults max_parallel_tasks=1; per-owner quota (default 5 live ghosts) and a per-parent spawn rate limit apply — the skill should surface a clear message when quota-limited rather than retry-looping.
  • An ephemeral agent cannot spawn another ephemeral agent (depth-1 by design) — orchestrator must be a durable agent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions