t2849: Add repo routing guidance to self-improvement section#2850
t2849: Add repo routing guidance to self-improvement section#2850alex-solovyev merged 4 commits intomainfrom
Conversation
Self-improvement tasks created by supervisors running in project repos were being filed in the current project instead of the aidevops repo when they targeted framework components. Add a routing heuristic to both AGENTS.md (Self-Improvement section) and build.txt (Cross-repo task creation) so agents distinguish framework-level issues from project-specific ones and route to the correct repo using claim-task-id.sh and gh issue create --repo. Closes #2849
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where self-improvement tasks generated by supervisors were being incorrectly filed in project-specific repositories instead of the core Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdds routing rules and conditional issue-creation for agent self‑improvement: detect whether observations target aidevops framework or the current project, allocate task IDs with Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Agent as Agent
participant Claim as claim-task-id.sh
participant GH as GitHub API
participant Repo as Destination Repo
Agent->>Agent: Analyze observation (files, scripts, paths)
alt framework-related detected (e.g., ~/.aidevops/, ai-actions.sh)
Agent->>Claim: request task ID (--repo-path aidevops)
Claim-->>Agent: returns token (ref:GH# / ref:GL# / local token)
alt no existing ref / need issue
Agent->>GH: gh issue create --repo aidevops
GH-->>Agent: issue number / URL
Agent->>Repo: write TODO / reference ref:GH#NNN
end
else project-related
Agent->>Claim: request task ID (current repo)
Claim-->>Agent: returns token (ref:GH# / ref:GL# / local token)
alt no existing ref / need issue
Agent->>GH: gh issue create --repo current
GH-->>Agent: issue number / URL
Agent->>Repo: write TODO / reference ref:GH#NNN
end
end
Agent->>Agent: proceed with worktree + PR flow if code edits required
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Mar 4 22:32:23 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Code Review
This pull request adds important guidance to both the agent documentation (AGENTS.md) and the agent prompts (build.txt) on how to correctly route self-improvement tasks to either the project-specific repository or the central aidevops framework repository. The changes are clear, well-motivated, and directly address the problem of framework-related tasks being incorrectly filed in project repositories. I have one minor suggestion to improve consistency between the two updated files.
Note: Security Review has been skipped due to the limited scope of the PR.
.agents/prompts/build.txt
Outdated
| 3. Create a GitHub issue: `gh issue create --repo <slug> --title "tNNN: description"`. Record `ref:GH#NNN` in TODO.md. (If `claim-task-id.sh` already created the issue, this step is done.) | ||
| 4. Code changes in the current repo still require a worktree + PR as normal. | ||
|
|
||
| **Self-improvement repo routing:** When creating self-improvement tasks (see AGENTS.md "Self-Improvement"), route to the correct repo — not the repo you happen to be running in. Heuristic: if the observation references files under `~/.aidevops/`, framework scripts (`ai-actions.sh`, `ai-lifecycle.sh`, `supervisor/`, `dispatch.sh`, `pre-edit-check.sh`, helper scripts), agent prompt behaviour, or supervisor/pulse/orchestration logic, the task belongs in the aidevops repo. Use `claim-task-id.sh --repo-path <aidevops-path>` and `gh issue create --repo <aidevops-slug>`. Project-specific problems (CI, code, dependencies, domain logic) stay in the current repo. Framework tasks filed in project repos are invisible to framework maintainers and pollute the project's ID namespace. |
There was a problem hiding this comment.
For consistency with the guidance in AGENTS.md and to improve clarity for the agent, it's better to use the more descriptive placeholder <aidevops-repo-path> instead of <aidevops-path>. This makes it clearer that a path to a repository is expected.
**Self-improvement repo routing:** When creating self-improvement tasks (see AGENTS.md "Self-Improvement"), route to the correct repo — not the repo you happen to be running in. Heuristic: if the observation references files under `~/.aidevops/`, framework scripts (`ai-actions.sh`, `ai-lifecycle.sh`, `supervisor/`, `dispatch.sh`, `pre-edit-check.sh`, helper scripts), agent prompt behaviour, or supervisor/pulse/orchestration logic, the task belongs in the aidevops repo. Use `claim-task-id.sh --repo-path <aidevops-repo-path>` and `gh issue create --repo <aidevops-slug>`. Project-specific problems (CI, code, dependencies, domain logic) stay in the current repo. Framework tasks filed in project repos are invisible to framework maintainers and pollute the project's ID namespace.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/AGENTS.md:
- Around line 58-59: Update the guidance in AGENTS.md to clarify that gh issue
create should only be run when an issue hasn’t already been created by
claim-task-id.sh; change the wording around the two commands (claim-task-id.sh
and gh issue create) to make the second conditional (e.g., run gh issue create
only if claim-task-id.sh was invoked with --no-issue or if no ref:GH# token was
produced), and mention the check (presence of ref:GH# or the --no-issue flag) to
avoid duplicate issues.
In @.agents/prompts/build.txt:
- Around line 203-204: The guidance for routing self-improvement tasks may cause
duplicate issues because it always instructs running gh issue create --repo
after claim-task-id.sh; update the wording to mirror the conditional workflow
used in AGENTS.md (lines ~197-201) so that gh issue create --repo is only
invoked when claim-task-id.sh did not already create or reserve the issue ID;
specifically mention the heuristic for aidevops paths and update the
instructions around claim-task-id.sh and gh issue create --repo to be
conditional (i.e., run claim-task-id.sh --repo-path <aidevops-path> first, and
only call gh issue create --repo <aidevops-slug> when claim-task-id.sh did not
create the GitHub issue).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8cb2c20f-aecd-48c5-9cb6-6c4725a7d6c5
📒 Files selected for processing (2)
.agents/AGENTS.md.agents/prompts/build.txt
|
Fixed CodeRabbit CHANGES_REQUESTED findings in commit 27f65cf:
Applied consistently across all 3 locations:
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Mar 4 23:07:56 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
Dispatching worker to address CodeRabbit review feedback:
Worker dispatched to branch |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/AGENTS.md:
- Line 58: The duplicate-issue guard is checking for the wrong token format
(`ref:GH#`) while claim-task-id.sh emits `ref=GH#NNN` or `ref=GL#NNN`; update
the conditional logic or documentation text that references `ref:GH#` to expect
`ref=GH#`/`ref=GL#` (i.e. `=` not `:`) wherever the check occurs (references:
claim-task-id.sh output token, the guard that decides whether to run `gh issue
create`, and the textual references in AGENTS.md) so the guard correctly detects
existing issues and prevents duplicate `gh issue create` calls.
In @.agents/prompts/build.txt:
- Line 200: The guard that detects whether an issue was already created must
match the exact token format emitted by claim-task-id.sh; update the checks that
currently look for "ref:GH#" to instead look for "ref=GH#" and also accept
"ref=GL#" (or a regex covering ref=G[HL]#) so existing GitHub/GitLab refs are
recognized and you don't create duplicate issues; update the mention in the
steps (and any conditional logic that inspects claim-task-id.sh output) to use
the corrected token format and include both ref=GH# and ref=GL# variants.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 71a04bc4-79cd-4945-8c14-1551afd2ed56
📒 Files selected for processing (2)
.agents/AGENTS.md.agents/prompts/build.txt
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Mar 4 23:11:40 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
Fixed all CodeRabbit CHANGES_REQUESTED items:
All 4 inline CodeRabbit comments addressed. CI should pass on re-run. |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Mar 4 23:16:25 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
prompts/build.txtin the Cross-repo task creation section, reinforcing the same heuristic where cross-repo mechanics are documented~/.aidevops/, framework scripts (ai-actions.sh,ai-lifecycle.sh,supervisor/,dispatch.sh, etc.), agent prompt behaviour, supervisor/pulse logicProblem
Supervisors running
/pulseagainst non-aidevops repos were creating self-improvement tasks (TODO entries + GitHub issues) in the current project repo even when the improvement targeted aidevops framework internals. This caused:aidevops updateEvidence: t3644, t4107, t9411 all filed in qs-agency but targeting
ai-actions.sh, supervisor evaluate/dispatch, andai-lifecycle.sh.Changes
.agents/AGENTS.md.agents/prompts/build.txtCloses #2849
Summary by CodeRabbit