fix: set child subtasks to completed (not in_review) and improve comment reply resilience#11
Merged
Merged
Conversation
…ent reply resilience Child subtasks created for UI visibility during planning don't have their own PRs, so setting them to in_review was semantically wrong and confusing. Now only the parent task gets in_review when a PR is created; subtasks always get completed. Also improves comment reply handling: - Add COMMENT_REPLY_TEXT_ONLY_PROMPT for when worktree cannot be recreated, so the agent doesn't falsely claim it has code access - Add better logging/diagnostics throughout _get_or_create_reply_worktree when recreation fails, making silent tmpdir fallback more visible - Add _maybe_rebase_for_merge_conflicts: when a comment mentions merge conflicts and the worktree is recreated, attempt git rebase onto the base branch before handing off to the agent - Pass comment_body to worktree helper to enable conflict-aware rebase - Add 9 new tests covering subtask status, text-only prompt fallback, worktree recreation, and rebase logic Made-with: Cursor
- Remove unused plan_json in test_subtasks_completed_when_no_pr (ruff F841) - Patch web_mod.AUTH_ENABLED=False in test client so /api tests pass when host env sets AUTH_EMAIL/AUTH_PASSWORD (conftest setdefault does not override) Made-with: Cursor
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
Subtask status fix: Child subtasks created during planning for UI visibility are now always set to
completedinstead of inheriting the parent'sin_reviewstatus. Only the parent task getsin_reviewwhen a PR is created — subtasks don't have their own PRs, soin_reviewwas semantically wrong.Text-only comment reply prompt: Added
COMMENT_REPLY_TEXT_ONLY_PROMPTthat is used when the worktree cannot be recreated. Previously the agent was told "you are running inside the same git worktree" even when falling back to a tmpdir, causing it to falsely claim it could edit files.Better worktree diagnostics:
_get_or_create_reply_worktreenow logs detailed warnings when repo resolution fails, git fetch fails, worktree add fails, or unexpected errors occur — making the silent fallback to tmpdir visible in logs.Merge conflict rebase support: New
_maybe_rebase_for_merge_conflictsfunction detects when a comment mentions merge conflicts and automatically attemptsgit rebase origin/<default-branch>in the recreated worktree before the agent runs. Falls back gracefully with--abortif the rebase itself conflicts.9 new tests covering all the above scenarios.
Test plan
completedwhen parent getsin_reviewMade with Cursor