Skip to content

[feat] Run prompt and agent steps with the local driver #1077

Closed

Description

@hsuchifeng

Parent: #818

Goal

Extend the local driver to execute real AI-tool steps while leaving workflow semantics and output validation in TeamAI’s engine.

Scope

  • Add prompt, prompt_file, and optional agent.
  • Resolve prompt files safely inside the team repo when the workflow is pulled and cache them with the validated definition.
  • Keep cached prompts revision-bound so a run at an older revision does not read a later edit or a deleted file.
  • Resolve named agents from files already deployed by teamai pull.
  • Add a small local tool-adapter interface for supported headless tools.
  • Read per-machine workflow tool selection, with CLI overrides suitable for CI.
  • Give each attempt a private result.json location outside the product checkout.
  • Have the engine validate reported output against the declared shorthand schema.
  • Report tool, concrete model when known, session handle, token counts, and structured failure details.
  • Detect a read-only agent step that leaves repository changes and fail it while preserving those changes for inspection.
  • Consume deployed agent configuration directly; do not make model aliases a runtime dependency.
  • Add shared conformance scenarios that run through both the in-process engine and next/report --json, including the CLI-only parseReport path.

Out of scope

Session continuation, editable worktrees, branch delivery, graph control flow, human gates, and remote drivers.

Dependencies

Acceptance criteria

  • A prompt-only workflow runs through one configured local AI tool.
  • A named agent is leased only when available in the selected tool environment.
  • Missing tools, missing agents, invalid output, and child-process failures become stable step failures.
  • The adapter cannot bypass engine output validation.
  • Prompts, outputs, and secrets are not logged by default.
  • A raw model or tool default works without model aliases.
  • A run at an older revision uses its cached prompt_file content after the source file is changed or deleted.
  • The same conformance scenarios produce equivalent results through the in-process engine and next/report --json.

Verification

Focused adapter, agent-lookup, result-parsing, diagnostic, prompt-cache, and direct/CLI conformance tests; build/typecheck/lint; one real-CLI E2E with one representative AI executable. Update the bilingual workflow guide for agent steps.

Activity

  1. SaulMoro commented on Oct 13, 2026

    @SaulMoro
    Collaborator

    Two ideas for this one:

    • The conformance suite from Discussion: Workflow Runtime Integration #818 (the same scenarios through the in-process engine and through next/report --json) is planned for [feat] Add a Paseo driver adapter #1087, the last ticket. Since the local driver starts growing here, maybe it could land here and [feat] Add a Paseo driver adapter #1087 reuse it? There's already a small gap: parseReport only runs on the CLI path.
    • The cache keeps the last valid YAML, but prompt_file is read at run time, so a workflow kept at its old version would run the new prompt, or fail on a deleted one. Maybe pull could check that the file exists and cache it with the definition?
  2. hsuchifeng commented on Oct 14, 2026

    @hsuchifeng
    CollaboratorAuthor

    The conformance suite lands here: the same scenarios through the in-process engine and through next/report --json. #1087 reuses it. That also covers parseReport, which currently runs only on the CLI path.

    prompt_file is checked when the workflow is pulled and cached with the definition. A run pinned to an older revision uses that cached prompt, even if the source file is later changed or deleted.

    Remote drivers stay out of scope.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions