Conversation
…skType misclassification (#115) Root cause: tasks containing both 'research' and 'fix/implement' keywords were misclassified as 'research' because the research regex matched first. With taskType='research', all workflow gates were disabled, allowing the LLM to mark read-only sessions as 'complete'. Changes: - Refactor inferTaskType() to prioritize coding action keywords (fix, implement, add, create, etc.) over research classification. Add GitHub issue URL detection. - Add PLANNING LOOP CHECK rules to self-assessment and judge GenAI prompts so the LLM itself detects when a coding task only has read operations. - Add planning loop rule to stuck-detection eval prompt (scoped to message_completed=true to avoid interfering with 'working' priority). - Mirror inferTaskType() fix in test-helpers. - Add unit tests for inferTaskType, evaluateSelfAssessment, detectPlanningLoop, and buildEscalatingFeedback. - Add eval test case for planning loop detection. All evals pass: judge 23/23, stuck 18/18, compression 12/12. Unit tests: 320 pass (5 skipped).
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.
Summary
Fixes #115 — sessions where the agent only reads/explores files but never implements code changes were being marked as "complete" by the reflection plugin.
Root Cause (two interacting bugs)
inferTaskType()misclassification: The regexresearch|investigate|analyze|compare|evaluate|studymatched beforefix|bug|issue|error|regression. Tasks containing both "investigate" AND "fix" were classified as"research"instead of"coding".Research tasks bypass ALL workflow gates: When
taskType === "research",requiresTests,requiresBuild,requiresPR, andrequiresCIare all set tofalse. With no requirements,evaluateSelfAssessment()findsmissing.length === 0, and if the LLM returnsstatus: "complete", the task is marked complete without feedback.No planning loop detection in GenAI prompts: The self-assessment and judge prompts had no rule checking whether the agent actually made code changes vs only reading/exploring.
Changes
inferTaskType()refactored — prioritizes coding action keywords (fix,implement,add,create, etc.) over research classification; adds GitHub issue URL detectionstatus: "in_progress"/complete: falsewhen a coding task shows only read operationsmessage_completed: true(avoids interfering with "WORKING" priority when tools are still running)inferTaskType()inreflection-3.test-helpers.tsupdated identicallyinferTaskType,evaluateSelfAssessment,detectPlanningLoop,buildEscalatingFeedbackDesign Decision
Per feedback on PR #114, planning loop detection is done entirely via GenAI prompts, not mechanical heuristics or counters. The
detectPlanningLoop()function still exists and is used forbuildEscalatingFeedback()(choosing feedback text style), but does NOT mechanically overrideanalysis.complete.Test Results
npm testeval:judgeeval:stuckeval:compression