Skip to content

feat(agent): make the self-review critic prompt configurable per-workflow (fast follow to #262) #536

Description

@nizar-lahlali

Summary

Fast follow to #262 / PR #263. The pre-PR self-review (critic) step currently uses a hardcoded prompt constant (SELF_REVIEW_PROMPT in agent/src/prompts/self_review.py). Make the critic prompt configurable per-workflow instead of constant, so workflow authors can tune the review focus (e.g. security-heavy vs. style-heavy critique) without a code change.

Motivation

Raised during review of PR #263: the critic's behavior is entirely prompt-driven, but the prompt is baked into the agent image. Workflows already configure the step's max_turns in YAML — the prompt should be configurable the same way.

Acceptance Criteria

  • self_review step accepts an optional prompt field in workflow YAML (schema + Step model)
  • run_self_review() renders the custom template with {diff} / {task_description} placeholders; falls back to the built-in prompt on a malformed template (fail-open, logged)
  • Step handler threads step.prompt through to run_self_review()
  • Built-in prompt remains the default when the field is omitted — no behavior change for existing workflows
  • Unit tests for rendering, fallback, and handler threading
  • Workflow-validation corpus fixture covering a self_review step with a custom prompt

Task Type

new_task

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions