Skip to content

feat: update dev-loop workflow and polling strategy#9

Merged
lollipopkit merged 5 commits intomainfrom
feat/update-dev-loop-workflow
Jan 16, 2026
Merged

feat: update dev-loop workflow and polling strategy#9
lollipopkit merged 5 commits intomainfrom
feat/update-dev-loop-workflow

Conversation

@lollipopkit
Copy link
Copy Markdown
Owner

@lollipopkit lollipopkit commented Jan 16, 2026

Description

This PR updates the dev-loop plugin to improve the PR review polling strategy and documentation.

Changes

  • Updated plugin.json version to 1.0.1.
  • Enhanced dev-loop-runner.md with:
    • Instructions to create a GitHub issue if one doesn't exist.
    • GraphQL-based PR review comment fetching to filter out outdated and resolved comments.
    • Autonomous polling strategy using sleep instead of waiting for user input.
  • Updated SKILL.md to:
    • Reflect version 1.0.1.
    • Include the new GitHub issue creation workflow.
    • Detail the GraphQL-based review fetching and autonomous polling logic.
    • Remove deprecated external review mode documentation.

Closes #8

Summary by CodeRabbit

  • New Features

    • Offer to create a GitHub issue when none is provided
    • Smarter branch/PR handling: find or create descriptive branches and reuse existing PR branches
    • Improved review polling using GraphQL to ignore outdated/resolved threads
    • Autonomous polling with progressive waits and 30-minute stop; applies feedback immediately on new comments
  • Chores

    • Bumped plugin/skill versions to 1.0.3
    • Removed external LLM review and custom command flows

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 16, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Bumps dev-loop plugin version to 1.0.3 and updates workflow/docs to offer creating a GitHub issue when none exists, refine branch selection/creation and resume behavior, and replace prior polling with GraphQL-based autonomous review polling with progressive waits and a 30-minute stop condition.

Changes

Cohort / File(s) Summary
Plugin manifest
plugins/dev-loop/.claude-plugin/plugin.json
version changed from 0.1.0 to 1.0.3 (single-field bump).
Dev-loop runner documentation
plugins/dev-loop/agents/dev-loop-runner.md
Adds interactive GitHub issue creation when no issue identifier; improves branch association/creation and PR-resume logic; replaces simple polling with a GraphQL query + jq filter to select active review comments; implements autonomous polling (initialize current_wait = 60s, cumulative_wait = 0; sleep cycles increment current_wait by 60s; stop when cumulative wait > 1800s); on new comments proceed immediately to apply feedback.
Dev-loop skill documentation
plugins/dev-loop/skills/dev-loop/SKILL.md
Frontmatter version bumped to 1.0.3; "Fetch" step renamed to "Fetch/Create issue context" and documents prompting/creating issues via gh issue create; clarifies branch validation and descriptive branch behavior; renames implement step to "Implement minimal fix"; documents GraphQL-based comment filtering and autonomous polling with progressive waits and 30-minute hard stop; removes External LLM review and Custom command integration sections.

Sequence Diagrams

sequenceDiagram
    participant User
    participant Agent as Dev-loop Agent
    participant GitHub as GitHub (gh CLI)
    User->>Agent: Provide task description (no issue)
    Agent->>User: Confirm creating new GitHub issue?
    User->>Agent: Yes
    Agent->>GitHub: gh issue create --title "..." --body "..."
    GitHub-->>Agent: Issue URL & number
    Agent->>Agent: Store issue number and continue workflow
Loading
sequenceDiagram
    participant Agent as Dev-loop Agent
    participant GitHub as GitHub (GraphQL API)
    participant Reviewer
    Agent->>Agent: Initialize current_wait = 60s, cumulative_wait = 0
    loop Autonomous Polling
        Agent->>GitHub: GraphQL query for PR review comments (filter out outdated/resolved)
        GitHub-->>Agent: Active review comments (if any)
        alt New comments detected
            Agent->>Agent: Proceed to Apply Feedback
            Agent->>Agent: Reset polling cycle
        else No new comments
            Agent->>Agent: Check cumulative_wait + current_wait > 1800s?
            alt Exceeded 30 minutes
                Agent->>Agent: Stop polling (timeout)
            else Within limit
                Agent->>Agent: Sleep current_wait seconds
                Agent->>Agent: cumulative_wait += current_wait
                Agent->>Agent: current_wait += 60s
            end
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • opt.: dev-loop workflow #6: Modifies dev-loop branching and review-wait logic (branch creation/association and polling strategy) — closely related to polling and branch behavior changes here.
  • refactor: issue-loop -> dev-loop #4: Updates dev-loop plugin manifest and documentation files, overlapping with manifest/version and docs edits in this change.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating the dev-loop workflow and implementing a new polling strategy using GraphQL-based autonomous polling.
Linked Issues check ✅ Passed The pull request implements all coding objectives from issue #8: GitHub issue creation prompts, GraphQL-based comment filtering, autonomous polling strategy, and version updates to both plugin.json and SKILL.md.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #8 objectives: version bumps (0.1.0→1.0.3), GitHub issue creation workflow, GraphQL polling implementation, and documentation updates reflect the scope defined in the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/update-dev-loop-workflow

🧹 Recent nitpick comments
plugins/dev-loop/agents/dev-loop-runner.md (3)

74-78: Consider clarifying whether PR lookup on non-base branches occurs after issue creation.

Line 78's "Additionally" suggests the PR lookup on non-base branches happens independently of the issue identifier workflow above it. If the intent is that PR lookup should occur even after successfully creating an issue (to check for existing PRs to resume), this works. However, if PR lookup should only happen when no issue identifier exists, the current wording could be misleading.

✍️ Optional clarification

If PR lookup should only occur when no issue identifier exists:

-   - If still NO issue identifier is provided: use `gh pr list --head $(git branch --show-current) --json number,url,title,body` to find an associated PR.
-   - Additionally, if on a non-base branch: also check for an existing PR associated with the current branch.
+   - If still NO issue identifier is provided: use `gh pr list --head $(git branch --show-current) --json number,url,title,body` to find an associated PR (especially relevant when on a non-base branch).

Or if PR lookup should always happen on non-base branches regardless:

-   - Additionally, if on a non-base branch: also check for an existing PR associated with the current branch.
+   - Additionally, if on a non-base branch: always check for an existing PR using `gh pr list` to resume work if one exists, even if an issue identifier was provided.

97-120: Add error handling for GraphQL query failures.

The GraphQL query lacks error handling for network failures, API errors, or malformed responses. If gh api graphql fails, the polling loop could behave unpredictably.

📋 Suggested error handling guidance

Add a note in the documentation about error handling:

     ' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isOutdated == false and .isResolved == false) | .comments.nodes[]'
     ```
+
+   - Handle GraphQL errors: If the query fails (network issues, API errors), log the error and retry with exponential backoff before continuing the polling cycle.

122-139: Excellent autonomous polling strategy with progressive backoff.

The polling implementation is well-designed:

  • Progressive wait times (1m, 2m, 3m, ...) reduce API pressure
  • 30-minute cumulative limit prevents indefinite waiting
  • Reset on new comments ensures responsiveness
  • Example sequence is mathematically correct and helpful

Optional enhancement: Consider documenting how to handle sleep interruption (e.g., if user presses Ctrl+C during sleep) to gracefully exit the polling loop.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f8676c and adce36a.

📒 Files selected for processing (1)
  • plugins/dev-loop/agents/dev-loop-runner.md
🧰 Additional context used
🪛 LanguageTool
plugins/dev-loop/agents/dev-loop-runner.md

[style] ~77-~77: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...` and use the returned URL/number. - If still NO issue identifier is provided: ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (1)
plugins/dev-loop/agents/dev-loop-runner.md (1)

45-45: Good addition documenting GitHub issue creation capability.

This line correctly summarizes the new workflow feature detailed in lines 74-76.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3738902b00

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +101 to +105
reviewThreads(first: 50) {
nodes {
isOutdated
isResolved
comments(last: 10) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Paginate review threads to avoid missing comments

The documented GraphQL query only fetches the first 50 review threads and the last 10 comments per thread. On PRs with more than 50 threads or long-running discussions, unresolved feedback outside this window will be invisible to the polling logic, so the workflow can conclude “no new comments” and stop even though actionable review items still exist. Consider adding pagination (pageInfo + loop) or raising limits and iterating until all unresolved threads are captured.

Useful? React with 👍 / 👎.

- Increase reviewThreads limit to 100 and comments to 20 in GraphQL query
- Synchronize polling reset behavior documentation
- Improve wording to avoid repetitive sentence beginnings
- Bump version to 1.0.2
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@plugins/dev-loop/agents/dev-loop-runner.md`:
- Around line 74-77: Clarify the ambiguous conditional by explicitly separating
the two flows: 1) If NO issue identifier is provided, call AskUserQuestion to
offer creation and if the user creates one via gh issue create --title
"<short_summary>" --body "<full_description>" use that identifier; if after that
there is still NO issue identifier, run gh pr list --head $(git branch
--show-current) --json number,url,title,body to find an associated PR. 2)
Independently, document whether git-branch-based PR lookup (gh pr list) should
also run on non-base branches even when an issue identifier already exists — if
yes, state that “on non-base branches also run gh pr list to find an associated
PR” otherwise state it will be skipped when an issue identifier exists; update
the text around AskUserQuestion, gh issue create, and gh pr list to reflect the
chosen behavior.

In `@plugins/dev-loop/skills/dev-loop/SKILL.md`:
- Line 4: Update the version entry in SKILL.md to match the plugin.json version:
locate the line containing "version: 1.0.1" in SKILL.md and change it to
"version: 1.0.2" (or change plugin.json instead if 1.0.1 is the intended
canonical version), then re-run a quick scan of other plugin metadata to ensure
all version fields are consistent.
- Around line 65-68: Clarify and tighten the conditional flow described: make it
explicit that the "non-base branch" check runs only when no issue identifier is
provided (i.e., after the free-form/file path branch and after the user either
declines creating a new issue or no issue was created), and update the text to
read like a single conditional sequence (e.g., "If no issue identifier is
provided, ... Otherwise, if on a non-base branch, ..."). Also vary sentence
openings for lines that currently all start with "If" by rephrasing one or two
lines (for example use "When" or "Otherwise") to improve readability while
keeping the referenced commands (`gh issue create ...` and `gh pr list --head
$(git branch --show-current) --json number,url,title,body`) intact.
🧹 Nitpick comments (1)
plugins/dev-loop/agents/dev-loop-runner.md (1)

121-135: Polling strategy logic is sound and well-documented.

The autonomous polling strategy with progressive backoff (5→6→7... minute waits) and a 30-minute cumulative limit is clearly explained. The example sequence accurately demonstrates the logic and termination condition.

Minor suggestion: explicitly state that the check happens before sleeping in each round, which is why Poll #5 stops at cumulative 26 minutes without the final sleep.

Optional clarification for step 3
     3. If NO new comments are found:
-       - If `cumulative_wait + current_wait > 1800` (30 minutes), stop polling and ask the user for guidance.
+       - Before sleeping, if `cumulative_wait + current_wait > 1800` (30 minutes), stop polling and ask the user for guidance.
        - Otherwise, use the `Bash` tool to run `sleep $current_wait`.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3738902 and efa8e97.

📒 Files selected for processing (3)
  • plugins/dev-loop/.claude-plugin/plugin.json
  • plugins/dev-loop/agents/dev-loop-runner.md
  • plugins/dev-loop/skills/dev-loop/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/dev-loop/.claude-plugin/plugin.json
🧰 Additional context used
🪛 LanguageTool
plugins/dev-loop/skills/dev-loop/SKILL.md

[style] ~68-~68: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ody ""` to create it. - If on a non-base branch and no issue is pr...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

plugins/dev-loop/agents/dev-loop-runner.md

[style] ~77-~77: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...` and use the returned URL/number. - If still NO issue identifier is provided, ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (4)
plugins/dev-loop/agents/dev-loop-runner.md (2)

45-45: LGTM! Issue creation support added.

The addition of GitHub issue creation capability aligns well with the PR objectives and provides a smoother workflow when no issue exists.


94-119: GraphQL limits increased; residual pagination risk remains.

The updated query now fetches first: 100 review threads and last: 20 comments per thread, significantly improving coverage compared to the previous 50/10 limits mentioned in past reviews. The isOutdated and isResolved filtering correctly focuses on actionable feedback.

However, on exceptionally active PRs (>100 threads or >20 comments per thread), some unresolved comments could still fall outside the query window. For most practical scenarios, these limits should suffice.

Based on past review comments, this addresses the pagination concern for typical use cases. If you expect PRs with >100 review threads, consider implementing full pagination with pageInfo and cursor-based iteration.

plugins/dev-loop/skills/dev-loop/SKILL.md (2)

32-36: LGTM! Issue creation workflow documented.

The guidance to create a GitHub issue when none exists aligns with the enhanced workflow and provides clear instructions for the autonomous agent.


84-118: GraphQL polling strategy matches runner implementation.

The GraphQL-based filtering and autonomous polling strategy are correctly documented and mirror the implementation in dev-loop-runner.md. The same strengths (improved limits to 100/20) and residual pagination considerations apply here.

See review comments on dev-loop-runner.md lines 94-119 for detailed analysis of the GraphQL approach and remaining edge cases.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

- Clarify ambiguous conditional logic in runner and skill
- Improve sentence variety to avoid repetitive starts
- Bump version to 1.0.3 across plugin files
@lollipopkit
Copy link
Copy Markdown
Owner Author

@coderabbitai Why still blocking this pr?

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 16, 2026

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check the current PR review status and decision
echo "=== PR Review Status ==="
gh pr view 9 --json reviewDecision,reviews,state,mergeable

# Check if there are any reviews from coderabbitai
echo -e "\n=== Reviews from coderabbitai ==="
gh pr view 9 --json reviews --jq '.reviews[] | select(.author.login == "coderabbitai[bot]") | {state: .state, submittedAt: .submittedAt}'

# Check for any comments from coderabbitai
echo -e "\n=== Comments from coderabbitai ==="
gh pr view 9 --json comments --jq '.comments[] | select(.author.login == "coderabbitai[bot]") | {body: .body, createdAt: .createdAt}'

# Check review threads/comments on the PR
echo -e "\n=== Review Comments from coderabbitai ==="
gh api "repos/lollipopkit/cc-plugins/pulls/9/comments" --jq '.[] | select(.user.login == "coderabbitai[bot]") | {path: .path, line: .line, body: .body, created_at: .created_at}'

Length of output: 18518


🏁 Script executed:

#!/bin/bash

# Check if commit c203006 exists in the PR
echo "=== Checking for commit c203006 ==="
gh pr view 9 --json commits --jq '.commits[] | select(.oid | startswith("c203006")) | {oid: .oid, messageHeadline: .messageHeadline}'

# Check the latest commit in the PR
echo -e "\n=== Latest commit in PR ==="
gh pr view 9 --json commits --jq '.commits[-1] | {oid: .oid, messageHeadline: .messageHeadline, committedDate: .committedDate}'

# Check current version in plugin.json
echo -e "\n=== Current version in plugin.json ==="
cat plugins/dev-loop/.claude-plugin/plugin.json | jq '.version'

# Check current version in SKILL.md
echo -e "\n=== Current version in SKILL.md ==="
grep -n "^version:" plugins/dev-loop/skills/dev-loop/SKILL.md | head -1

Length of output: 439


🏁 Script executed:

#!/bin/bash

# Check the conditional logic in dev-loop-runner.md (around lines 74-77)
echo "=== Conditional logic in dev-loop-runner.md (lines 74-80) ==="
sed -n '74,80p' plugins/dev-loop/agents/dev-loop-runner.md

# Check the conditional logic in SKILL.md (around lines 65-68)
echo -e "\n=== Conditional logic in SKILL.md (lines 65-70) ==="
sed -n '65,70p' plugins/dev-loop/skills/dev-loop/SKILL.md

Length of output: 1290


@lollipopkit I apologize for the confusion! You're absolutely right—all the issues from my review have been addressed in commit c203006, but I hadn't submitted a new approval to update the review state.

I've now verified that:

  • Version consistency: Both plugin.json and SKILL.md now show version 1.0.3
  • Conditional logic clarity: Both files now have clear, well-structured conditional flows
  • Style improvements: The repetitive sentence structures have been fixed

All feedback has been properly implemented. Approving now to unblock the PR!

✅ Actions performed

Comments resolved and changes approved.

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.

feat: update dev-loop workflow and polling strategy

1 participant