Skip to content

fix: set child subtasks to completed (not in_review) and improve comment reply resilience#11

Merged
gf5901 merged 2 commits into
mainfrom
task/73a5a596-task-issues
Mar 23, 2026
Merged

fix: set child subtasks to completed (not in_review) and improve comment reply resilience#11
gf5901 merged 2 commits into
mainfrom
task/73a5a596-task-issues

Conversation

@gf5901
Copy link
Copy Markdown
Owner

@gf5901 gf5901 commented Mar 23, 2026

Summary

  • Subtask status fix: Child subtasks created during planning for UI visibility are now always set to completed instead of inheriting the parent's in_review status. Only the parent task gets in_review when a PR is created — subtasks don't have their own PRs, so in_review was semantically wrong.

  • Text-only comment reply prompt: Added COMMENT_REPLY_TEXT_ONLY_PROMPT that 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_worktree now 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_conflicts function detects when a comment mentions merge conflicts and automatically attempts git rebase origin/<default-branch> in the recreated worktree before the agent runs. Falls back gracefully with --abort if the rebase itself conflicts.

  • 9 new tests covering all the above scenarios.

Test plan

  • Verify all 299 existing tests pass (excluding pre-existing test_api.py auth issue)
  • Verify subtasks get completed when parent gets in_review
  • Verify text-only prompt is used when worktree returns None
  • Verify code-access prompt is used when worktree exists
  • Verify rebase is attempted when comment mentions merge conflicts
  • Verify rebase abort on failure
  • Verify no rebase without conflict keywords

Made with Cursor

gf5901 added 2 commits March 23, 2026 02:46
…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
@gf5901 gf5901 merged commit db499df into main Mar 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant