Skip to content

[Substrate] Dispatch integration — route runs to a Substrate Actor vs Job #74

Description

@Sam123ben

Part of the Agent Substrate epic ⬆️. Depends on #D.

Goal

Route a DevAI pipeline run/stage to a Substrate Actor when the agent targets Substrate, and to an ephemeral Job otherwise — on demand, with clean fallback.

Today (grounded)

JobRunnerStage.execute checks _maybe_dispatch_kagent (A2A over {kagent_url}/api/a2a/{ns}/{agent}) BEFORE the Job path; unlabelled agents fall through to a K8s Job. There's an operator kill-switch (DEVAI_KAGENT_ENABLED, default off) and per-user passthrough (forwards the user's key as the A2A bearer). We also just landed a NATS WorkQueue run-dispatch backend (separate, off by default).

Tasks

  • Extend _maybe_dispatch_kagent to address a Substrate Actor (A2A endpoint may differ; confirm the SandboxAgent A2A surface).
  • Keep degrade-to-Job on any Substrate error (never a SPOF) + the kill-switch gate.
  • On-demand semantics: confirm cold-start is acceptable per-run (#A); if the Actor is scaled-to-zero, the first dispatch wakes it.
  • Carry per-user key passthrough into the SandboxAgent ModelConfig (see #G).
  • Decide interplay with the NATS WorkQueue run-dispatch (run-level queue) vs Actor (agent-level exec) — they compose, document it.

Acceptance

A labelled agent run dispatches to its Substrate Actor and returns; killing the switch or a Substrate error transparently falls back to a Job.

Refs: src/devai/pipeline/stages/job_runner.py, src/devai/agentic/kagent_client.py; memory: Agent Harness + kagent, Model Policy + Boardroom, NATS WorkQueue Dispatch.

— Part of #69

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-substratekagent Agent Substrate adoptionenhancementNew feature or requestkagentkagent / agent runtime

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions