-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix human_review status bugs (#1149, #509) #1425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -190,6 +190,24 @@ def _validate_and_fix_implementation_plan() -> tuple[bool, list[str]]: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print(f"Continuing build: {highlight(spec_dir.name)}") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print_progress_summary(spec_dir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix for #509: Transition from human_review to in_progress after approval | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # When continuing a build that was approved, ensure we transition out of human_review | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plan = load_implementation_plan(spec_dir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if plan and plan.status == "human_review" and plan.planStatus == "review": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from review.state import ReviewState | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| review_state = ReviewState.load(spec_dir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if review_state.is_approval_valid(spec_dir): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # User approved the plan - transition to in_progress now that execution begins | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plan.status = "in_progress" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plan.planStatus = "in_progress" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plan_file = spec_dir / "implementation_plan.json" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plan.save(plan_file) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print_status("Transitioned from human_review to in_progress after approval", "success") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+195
to
+205
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🐛 One possible fix (apps/backend/implementation_plan/plan.py)- if self.status == "human_review" and self.planStatus == "review":
- pass
- else:
- self.status = "backlog"
- self.planStatus = "pending"
+ if self.status == "human_review" and self.planStatus == "review":
+ pass
+ elif self.status == "in_progress" and self.planStatus == "in_progress":
+ # Preserve explicit transition after approval
+ pass
+ else:
+ self.status = "backlog"
+ self.planStatus = "pending"🧰 Tools🪛 GitHub Actions: Lint[error] 195-195: Ruff format check detected formatting changes. 2 files would be reformatted. Run 'ruff format' to fix formatting. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Plan changed after approval or not approved - stay in human_review | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print_status("Plan requires re-approval before execution can continue", "warning") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+195
to
+209
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block has a bug: The logic should be updated to correctly load an
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Check if already complete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if is_build_complete(spec_dir): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print_build_complete_banner(spec_dir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -167,7 +167,17 @@ def update_status_from_subtasks(self): | |||||||||||||||||||||||||||||||||||||
| all_subtasks = [s for p in self.phases for s in p.subtasks] | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| if not all_subtasks: | ||||||||||||||||||||||||||||||||||||||
| # No subtasks yet - stay in backlog/pending | ||||||||||||||||||||||||||||||||||||||
| # No subtasks yet - check if this is a failed planning state | ||||||||||||||||||||||||||||||||||||||
| # Fix for #1149: If status is human_review but no phases/subtasks exist, | ||||||||||||||||||||||||||||||||||||||
| # planning crashed - reset to backlog instead of preserving invalid state | ||||||||||||||||||||||||||||||||||||||
| if self.status == "human_review" and not self.phases: | ||||||||||||||||||||||||||||||||||||||
| # Planning failed - don't show as human_review with Resume button | ||||||||||||||||||||||||||||||||||||||
| self.status = "backlog" | ||||||||||||||||||||||||||||||||||||||
| self.planStatus = "pending" | ||||||||||||||||||||||||||||||||||||||
| self.recoveryNote = "Planning phase failed - no implementation plan created" | ||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+170
to
+178
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ruff format is failing for this file. CI indicates 🧰 Tools🪛 GitHub Actions: Lint[error] 174-174: Ruff format check detected formatting changes. Run 'ruff format' to fix formatting. 🤖 Prompt for AI AgentsBroaden the failed-planning reset to cover empty phases with zero subtasks. In this 🐛 Proposed fix- if self.status == "human_review" and not self.phases:
+ if self.status == "human_review":📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Actions: Lint[error] 174-174: Ruff format check detected formatting changes. Run 'ruff format' to fix formatting. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| # Normal case: No subtasks yet - stay in backlog/pending | ||||||||||||||||||||||||||||||||||||||
| if not self.status: | ||||||||||||||||||||||||||||||||||||||
| self.status = "backlog" | ||||||||||||||||||||||||||||||||||||||
| if not self.planStatus: | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.