fix(gate): evidence-incomplete no longer hard-blocks task completion when session state confirms gates passed#780
Merged
zaxbysauce merged 5 commits intomainfrom May 7, 2026
Conversation
… gates
When update_task_status("in_progress") creates the evidence file with
gates:{}, a silent evidence recording failure in the delegation hook
would leave gates empty. checkReviewerGate was returning blocked:true
immediately based on the empty evidence file, without consulting the
in-memory session state which the delegation hook correctly advances
to tests_run independently of evidence recording.
Fix: save the evidence-incomplete reason and fall through to the full
session-state / delegation-chain fallback stack. Only block after all
fallbacks are exhausted, using the evidence-specific reason for its
more informative "missing gates: [X]" message.
Also fix the /^\d+\.\d+$/ regex in delegation-gate.ts (two places) to
use isStrictTaskId() which correctly accepts N.M.P format task IDs.
Agent-Logs-Url: https://github.com/zaxbysauce/opencode-swarm/sessions/2dd206a5-05d3-4aeb-94c2-e4be628a03b1
Co-authored-by: zaxbysauce <10211642+zaxbysauce@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix not updating plan issue in gate system
fix(gate): evidence-incomplete no longer hard-blocks task completion when session state confirms gates passed
May 6, 2026
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update_task_status("in_progress")always creates.swarm/evidence/<task>.jsonwithgates: {}. If evidence recording in the delegation hook subsequently fails silently (lock timeout, permission error), the gates stay empty on disk — causingcheckReviewerGateto returnblocked: truepermanently, even though the in-memory session state was correctly advanced totests_runby the same hook.Root cause
checkReviewerGatetreated an evidence file with incomplete gates as immediately authoritative, returning blocked without consulting session state, delegation chains, or plan.json:State advancement (in-memory) and evidence recording are independent operations in the
toolAfterhook — state advances first and always; evidence write can fail silently. The fix aligns the incomplete-evidence path with the existing ENOENT path: session state and delegation chains become the authority when evidence is untrustworthy.Changes
src/tools/update-task-status.ts—checkReviewerGate: incomplete evidence saves the specific missing-gates reason and falls through to all existing session-state / delegation-chain fallbacks; the evidence reason is used in the final blocked return (more informative than the generic session message)src/hooks/delegation-gate.ts— replace/^\d+\.\d+$/(two occurrences) withisStrictTaskId(), which correctly acceptsN.M.Pformat task IDssrc/tools/update-task-status.gates.test.ts— three new regression tests:gates:{} + tests_run → pass,gates:{} + idle → block (with gate names),partial gates + tests_run → pass