Bug Report
Related to: #2 (gate timeout unrecoverable), #3 (NL misrouting)
Summary
After the plan gate is approved, the worker phase ([2] Implementing...) immediately exits with:
✘ Spec appears incomplete — '## Copilot Instructions Block' section is missing.
✘ Regenerate with: devloop architect "<feature>"
bash-3.2$
The spec file exists and was just reviewed at the plan gate — the user approved a 6963-byte spec — yet the worker validation rejects it. The user is dropped to bare bash with no path forward.
Screenshot

What the screenshot shows:
- Plan gate runs successfully — reads prior task spec (
TASK-20260517-010743, 6963 bytes)
- User approves the plan gate:
[y]es / [n]o / [e]dit (120s timeout, default = reject) decision> y
- Worker starts:
[2] Implementing... Copilot active (next probe for Claude in 6s)
- Immediately fails:
Spec appears incomplete — '## Copilot Instructions Block' section is missing.
- Hint:
Regenerate with: devloop architect "<feature>" — but no feature name, no TASK-ID, no guidance
- Pipeline stops. User has no way to continue the existing task.
Root Cause
The validation in cmd_work (devloop.sh:5716):
# FIX #7: Validate spec completeness before handing to Copilot
if ! grep -q '^## Copilot Instructions Block' "$spec_file"; then
error "Spec appears incomplete — '## Copilot Instructions Block' section is missing."
error "Regenerate with: devloop architect \"<feature>\""
exit 1
fi
This validation is placed after the plan gate, meaning the user already approved the spec before being told it's invalid. Three compounding problems:
- Validation happens too late — should be in
cmd_architect, immediately after spec is generated
- Error message is not actionable — says
devloop architect "<feature>" without actual feature name or TASK-ID
- No auto-recovery — when called from
cmd_run, the pipeline could automatically re-architect rather than dying
When Does This Happen
- Architect LLM output gets truncated (token limit hit), omitting the
## Copilot Instructions Block section
- Spec was generated by an older DevLoop version that had a different section structure
- Spec was manually edited and the block was accidentally removed
- The
resume command loads a spec that pre-dates the ## Copilot Instructions Block format
Expected Behavior
1. Validate spec immediately after cmd_architect generates it:
✘ Spec is incomplete (missing '## Copilot Instructions Block') — retrying architect...
[1] Architecting... (attempt 2/2)
2. Actionable error message with exact commands:
✘ Spec TASK-20260517-010743 is missing '## Copilot Instructions Block'.
Hint: devloop architect "add dark mode" --task TASK-20260517-010743
Hint: devloop work TASK-20260517-010743 (after re-generating)
3. Inside cmd_run, auto-regenerate rather than crash:
⚠ Spec incomplete — re-architecting (attempt 2/2)...
[1] Architecting...
4. Plan gate should not display/approve an incomplete spec — _extract_plan_summary() should warn if ## Copilot Instructions Block is absent.
Suggested Fix Locations
| Location |
Fix |
cmd_architect (line ~5540) |
Validate block presence after spec written; retry if missing |
cmd_work (line 5716) |
Print TASK-ID and feature name in error message |
cmd_run work phase |
Catch incomplete-spec exit, re-architect inline |
approve_plan / plan gate |
Warn if spec is missing the Instructions Block before asking for approval |
Environment
- DevLoop: v5.1.0
- Spec file size: 6963 bytes (large enough to not be trivially truncated)
- Worker provider: Copilot (with Claude failover)
- Gate: plan gate (approved successfully before worker fails)
Bug Report
Related to: #2 (gate timeout unrecoverable), #3 (NL misrouting)
Summary
After the plan gate is approved, the worker phase (
[2] Implementing...) immediately exits with:The spec file exists and was just reviewed at the plan gate — the user approved a 6963-byte spec — yet the worker validation rejects it. The user is dropped to bare bash with no path forward.
Screenshot
What the screenshot shows:
TASK-20260517-010743, 6963 bytes)[y]es / [n]o / [e]dit (120s timeout, default = reject) decision> y[2] Implementing... Copilot active (next probe for Claude in 6s)Spec appears incomplete — '## Copilot Instructions Block' section is missing.Regenerate with: devloop architect "<feature>"— but no feature name, no TASK-ID, no guidanceRoot Cause
The validation in
cmd_work(devloop.sh:5716):This validation is placed after the plan gate, meaning the user already approved the spec before being told it's invalid. Three compounding problems:
cmd_architect, immediately after spec is generateddevloop architect "<feature>"without actual feature name or TASK-IDcmd_run, the pipeline could automatically re-architect rather than dyingWhen Does This Happen
## Copilot Instructions Blocksectionresumecommand loads a spec that pre-dates the## Copilot Instructions BlockformatExpected Behavior
1. Validate spec immediately after
cmd_architectgenerates it:2. Actionable error message with exact commands:
3. Inside
cmd_run, auto-regenerate rather than crash:4. Plan gate should not display/approve an incomplete spec —
_extract_plan_summary()should warn if## Copilot Instructions Blockis absent.Suggested Fix Locations
cmd_architect(line ~5540)cmd_work(line 5716)cmd_runwork phaseapprove_plan/ plan gateEnvironment