Skip to content

fix: default verify_feedback to empty string in single-step claimStep path#303

Open
frankleinadsr wants to merge 1 commit intosnarktank:mainfrom
frankleinadsr:bugfix/single-step-verify-feedback-missing
Open

fix: default verify_feedback to empty string in single-step claimStep path#303
frankleinadsr wants to merge 1 commit intosnarktank:mainfrom
frankleinadsr:bugfix/single-step-verify-feedback-missing

Conversation

@frankleinadsr
Copy link

Problem

Single non-loop steps with {{verify_feedback}} in their input_template fail before first execution when no prior retry has populated that key in the run context.

Observed error:

Step input is not ready: missing required template key(s) verify_feedback

Root Cause

claimStep() has two code paths: one for loop steps and one for single steps. The loop path correctly guards against missing verify_feedback by defaulting it to an empty string before calling findMissingTemplateKeys(). The single-step path did not apply the same guard.

When a single step's input_template contained {{verify_feedback}} and no prior retry had populated the key in the run context, findMissingTemplateKeys() reported it as a missing required key and failStepWithMissingInputs() fired immediately — marking the step and run as failed before any agent ever executed the step.

Fix

Added the same guard to the single-step path (~line 658 of src/installer/step-ops.ts):

// Optional retry feedback should not make first-pass single steps fail template resolution.
if (!context["verify_feedback"]) {
  context["verify_feedback"] = "";
}

The falsy check correctly handles both absent keys and empty-string values without overwriting a legitimately populated verify_feedback from a prior retry cycle.

Test

Added tests/single-step-verify-feedback.test.ts with:

  • Integration tests: claimStep() succeeds on first pass for a single step with {{verify_feedback}} and preserves real feedback on retry
  • Unit tests: demonstrate the guard logic and that the bug existed without it
  • Source code presence check: ensures the guard exists in both the loop and single-step paths

All 168 tests pass.

… path

The claimStep() function had an asymmetry between its loop and single step
paths. The loop path correctly guarded against missing verify_feedback by
defaulting it to an empty string before calling findMissingTemplateKeys(),
but the single-step path did not.

Any single step whose input_template contains {{verify_feedback}} would
fail on its very first execution when no prior retry had populated the key
in the run context. findMissingTemplateKeys() would report it as a missing
required key and failStepWithMissingInputs() would fire immediately, marking
the step and run as failed before any agent ever executed the step.

This was observed in the bug-fix workflow's 'fix' step:
  Step input is not ready: missing required template key(s) verify_feedback

Fix: add the same guard to the single-step path:
  if (!context["verify_feedback"]) { context["verify_feedback"] = ""; }

The falsy check correctly handles both absent keys and empty-string values
without overwriting a legitimately populated verify_feedback from a prior
retry cycle.

Also adds a regression test (tests/single-step-verify-feedback.test.ts) with:
- Integration tests proving claimStep succeeds on first pass and preserves
  real verify_feedback on retry
- Unit tests demonstrating the guard logic
- Source code presence check ensuring the guard exists in both paths
@vercel
Copy link

vercel bot commented Mar 11, 2026

Someone is attempting to deploy a commit to the Ryan Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant