angee.workflows_agents.steps
Workflow step implementation backed by the agents inference catalogue.
AgentStepImpl is the one-shot activity counterpart to workflow gates: it renders one prompt from a minimal Django-template context (subject, run, step), sends one non-streaming chat request through the selected inference provider backend, journals a bounded request/response summary on the step-run, and debits token usage onto the run budget ledger.
AGENT_STEP_JOURNAL_MAX_BYTES
Maximum UTF-8 JSON bytes stored in one agent step-run output journal.
AGENT_STEP_TRUNCATION_MARKER
Marker appended when an agent request/response journal is shortened.
SESSION_PARKED_UNTIL
Far-future durable wait used because StepResult.wait requires a due time.
SESSION_UPDATE_FLUSH_SECONDS
Minimum interval between streamed turn-row saves.
AgentStepImpl
class AgentStepImpl(StepImpl)One-shot workflow activity that calls an agents inference backend.
validate_config
@classmethod
def validate_config(cls, config: Any) -> NoneValidate one-shot agent step config.
run
def run(step_run: Any, *, now: datetime) -> StepResultExecute one one-shot inference request and return a routing outcome.
AgentSessionStepImpl
class AgentSessionStepImpl(StepImpl)Multi-turn agent session whose bounded turns run on workflow workers.
Idle sessions park at :data:SESSION_PARKED_UNTIL and wake only through workflows.engine.deliver. The update sink flushes ACP payloads at a bounded cadence while the runtime refreshes the step heartbeat independently every minute. Worker death mid-turn still fails the whole run in v1; durable mid-turn replay is intentionally deferred.
run
def run(step_run: Any, *, now: datetime) -> StepResultRun the oldest active/pending turn or park an idle session.
_TurnUpdateSink
@dataclass(slots=True)
class _TurnUpdateSink()Bounded ACP update flusher.
__call__
def __call__(update: dict[str, Any]) -> NoneBuffer one ACP payload and flush when the cadence bound elapsed.
flush
def flush() -> NoneAppend buffered updates to the persisted turn.