Skip to content

t1268: auto-detect plan refs from PLANS.md Task/TODO field in compose_issue_body#2000

Merged
marcusquinn merged 1 commit intomainfrom
feature/t1268
Feb 20, 2026
Merged

t1268: auto-detect plan refs from PLANS.md Task/TODO field in compose_issue_body#2000
marcusquinn merged 1 commit intomainfrom
feature/t1268

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 20, 2026

Auto-detect plan references from PLANS.md Task:/TODO: field and compose rich issue bodies.

Changes

  • find_plan_by_task_id(): scans PLANS.md for **TODO:** or **Task:** fields matching the task ID; supports subtask walk-up (t004.2 → t004)
  • extract_plan_extra_sections(): includes Context, Research, Architecture, Tool Matrix, Linkage, Phases, Risks, Open Questions beyond the 4 standard extractors
  • compose_issue_body(): when plan_link is empty, auto-detects via find_plan_by_task_id() before building the metadata header
  • Plan ID (p029, p025, etc.) extracted from TOON block for both explicit links and auto-detected plans; shown as | **Plan:** \pNNN`` in metadata header
  • enrich command automatically benefits — no manual → [...] links required

Ref #1999

Summary by CodeRabbit

  • New Features
    • Tasks now automatically link to relevant plan sections via task ID matching
    • Issue bodies display expanded plan context including Purpose, Context, and Architecture details
    • Progress, Discoveries, and Decisions sections are now collapsible, with additional plan information nested within

…issue_body (t1268)

- Add find_plan_by_task_id(): scans PLANS.md for **TODO:** or **Task:** fields
  matching the task ID; supports subtask walk-up (t004.2 → t004)
- Add extract_plan_extra_sections(): includes Context, Research, Architecture,
  Tool Matrix, Linkage, Phases, Risks, Open Questions, and other subsections
  beyond the 4 standard extractors
- Update compose_issue_body(): when plan_link is empty, auto-detect via
  find_plan_by_task_id() before building the metadata header
- Extract plan ID (p029, p025, etc.) from TOON block for both explicit links
  and auto-detected plans; include as | **Plan:** `pNNN` in metadata header
- Expand plan context sections: Context & Architecture (collapsed), Progress,
  Decision Log, Discoveries — all populated from auto-detected plan
- enrich command automatically benefits: compose_issue_body() now enriches
  all tasks with matching PLANS.md entries, no manual → [...] links required
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, 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 significantly enhances the issue-sync-helper script by introducing automated detection of plan references within PLANS.md and enriching the generated issue bodies with more comprehensive plan details. This streamlines the process of creating issues by reducing the need for manual linking and providing a more complete context directly within the issue description, improving clarity and efficiency for task management.

Highlights

  • Automated Plan Reference Detection: Introduced find_plan_by_task_id to automatically locate relevant plan sections in PLANS.md by scanning **TODO:** or **Task:** fields for task IDs, including support for subtask parent lookups (e.g., t004.2 maps to t004). This function also extracts the plan ID from TOON blocks.
  • Enriched Issue Body Content: Added extract_plan_extra_sections to pull in a broader range of structured plan details (e.g., Context, Research, Architecture, Tool Matrix, Linkage, Phases, Risks, Open Questions) into the generated issue body, presented under a collapsible "Plan: Context & Architecture" section.
  • Enhanced compose_issue_body Logic: The compose_issue_body function now intelligently auto-detects plan references if an explicit link is not provided, extracts the plan ID from TOON blocks for both explicit and auto-detected plans, and includes this plan ID in the issue's metadata header. This change also integrates the newly extracted extra sections into the issue body.
Changelog
  • .agents/scripts/issue-sync-helper.sh
    • Implemented find_plan_by_task_id to auto-detect plan references from PLANS.md using **TODO:** or **Task:** fields, including subtask parent lookup.
    • Introduced extract_plan_extra_sections to pull in additional plan subsections like Context, Research, and Architecture.
    • Modified compose_issue_body to leverage the new auto-detection logic for plan links when none are explicitly provided.
    • Ensured the plan ID (e.g., pNNN) is extracted from TOON blocks and displayed in the issue body's metadata header for both explicit and auto-detected plans.
    • Restructured compose_issue_body to include the newly extracted "extra sections" under a collapsible "Plan: Context & Architecture" section.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

Walkthrough

The PR adds plan detection and context enrichment to the issue sync helper script. Two new functions (find_plan_by_task_id and extract_plan_extra_sections) enable automatic task-to-plan linking by searching PLANS.md. The compose_issue_body function is enhanced to auto-detect plans via task ID, inject Plan metadata, and render additional plan sections in collapsible format.

Changes

Cohort / File(s) Summary
Plan Detection & Context Enrichment
.agents/scripts/issue-sync-helper.sh
Added find_plan_by_task_id() function to locate plans by matching task IDs (with subtask walk-up support). Added extract_plan_extra_sections() to retrieve additional plan subsections (Context, Research, Architecture, etc.). Enhanced compose_issue_body() to auto-detect plans via task ID lookup, inject detected Plan ID into metadata header, and render plan content with collapsible sections for Progress, Decisions, and Discoveries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🔍 Task IDs now dance with plans, auto-detected with care,
📋 Extra sections bloom from PLANS.md air,
📦 Collapsible wisdom for Progress and Decisions so fair,
✨ Zero debt maintained—DevOps excellence everywhere!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: auto-detecting plan references from PLANS.md in the compose_issue_body function, which is the primary objective of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t1268

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.

❤️ Share

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

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 30 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 20 03:41:47 UTC 2026: Code review monitoring started
Fri Feb 20 03:41:48 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 30

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 30
  • VULNERABILITIES: 0

Generated on: Fri Feb 20 03:41:50 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

coderabbitai[bot]
coderabbitai bot previously requested changes Feb 20, 2026
Copy link
Contributor

@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: 2

🧹 Nitpick comments (3)
.agents/scripts/issue-sync-helper.sh (3)

2858-2880: cmd_parse doesn't use auto-detect, so debug output is incomplete vs the composed body.

The === Plan Section === block (lines 2858-2880) only shows plan context when an explicit plan_link is present. But compose_issue_body (called at line 2887) now auto-detects plans via find_plan_by_task_id. A user running parse tNNN would see plan content in the composed body at the bottom but no plan section in the debug output above — potentially confusing when debugging auto-detect behavior.

♻️ Add auto-detect fallback to cmd_parse
 	if [[ -n "$plan_link" ]]; then
 		echo "=== Plan Section ==="
 		local plan_section
 		plan_section=$(extract_plan_section "$plan_link" "$project_root")
 		if [[ -n "$plan_section" ]]; then
 			echo "Purpose:"
 			extract_plan_purpose "$plan_section"
 			echo ""
 			echo "Decisions:"
 			extract_plan_decisions "$plan_section"
 			echo ""
 			echo "Progress:"
 			extract_plan_progress "$plan_section"
 		else
 			echo "(no plan section found for anchor: $plan_link)"
 		fi
 		echo ""
+	else
+		# Auto-detect plan from PLANS.md **TODO:**/**Task:** fields
+		local auto_detected
+		auto_detected=$(find_plan_by_task_id "$task_id" "$project_root")
+		if [[ -n "$auto_detected" ]]; then
+			echo "=== Plan Section (auto-detected) ==="
+			local detected_plan_id
+			detected_plan_id=$(echo "$auto_detected" | head -1)
+			local plan_section
+			plan_section=$(echo "$auto_detected" | tail -n +2)
+			[[ -n "$detected_plan_id" ]] && echo "Plan ID: $detected_plan_id"
+			echo "Purpose:"
+			extract_plan_purpose "$plan_section"
+			echo ""
+			echo "Decisions:"
+			extract_plan_decisions "$plan_section"
+			echo ""
+			echo "Progress:"
+			extract_plan_progress "$plan_section"
+			echo ""
+		fi
 	fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/issue-sync-helper.sh around lines 2858 - 2880, The debug
output in cmd_parse only prints a plan section when parse_task_line yields an
explicit plan_link, which omits plans auto-detected later by compose_issue_body
via find_plan_by_task_id; update cmd_parse so that if plan_link is empty it
attempts the same auto-detect fallback (call find_plan_by_task_id or
compose_issue_body's detection logic) to set plan_link and then call
extract_plan_section/ extract_plan_purpose/ extract_plan_decisions/
extract_plan_progress as before; reference the existing variables and functions
plan_link, parse_task_line, extract_plan_section, compose_issue_body, and
find_plan_by_task_id to mirror the composed-body behavior and ensure debug
output matches what compose_issue_body will produce.

1344-1353: Leading blank lines in output when first extra section is found.

When result is empty and the first heading matches, the concatenation produces \n\n**Heading**\n\n... — two leading blank lines. Inside the <details> tag at line 1678 this renders as extra whitespace before the first section.

✨ Trim leading whitespace
-		if [[ -n "$content" ]]; then
-			result="${result}"$'\n\n'"**${heading}**"$'\n\n'"${content}"
+		if [[ -n "$content" ]]; then
+			if [[ -n "$result" ]]; then
+				result="${result}"$'\n\n'"**${heading}**"$'\n\n'"${content}"
+			else
+				result="**${heading}**"$'\n\n'"${content}"
+			fi
 		fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/issue-sync-helper.sh around lines 1344 - 1353, The
concatenation always prefixes "\n\n" which adds two leading blank lines when
result is empty; fix the loop that builds result (using the extra_headings loop
and _extract_plan_subsection call) so it only prepends the "\n\n" separator for
subsequent sections and not for the first match—i.e., check if result is empty
before adding the separator and append "**${heading}**\n\n${content}" for the
first match, otherwise use the "\n\n**${heading}**\n\n${content}" form.

1598-1601: Misleading comment: plan ID is shown for both explicit and auto-detected plans.

The comment on line 1598 says "when auto-detected (no explicit link)" but detected_plan_id is also populated for explicit plan links (lines 1569-1571). The behavior is correct — the comment just doesn't reflect it.

📝 Fix comment
-	# Include plan ID in metadata header when auto-detected (no explicit link)
+	# Include plan ID in metadata header when available (explicit or auto-detected)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/issue-sync-helper.sh around lines 1598 - 1601, The comment
above the block that appends the plan ID is misleading: update the comment near
the block that checks detected_plan_id (the if [[ -n "$detected_plan_id" ]] {
... } section) to state that the plan ID is included for both auto-detected and
explicitly linked plans (since detected_plan_id is set for explicit links
earlier), so replace the "when auto-detected (no explicit link)" wording with a
neutral description like "include plan ID in metadata header when available."
🤖 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/scripts/issue-sync-helper.sh:
- Around line 1674-1679: The markdown inside the <details> block is missing a
blank line after </summary>, so update the body construction where
extra_sections is appended (the block that sets
extra_sections=$(extract_plan_extra_sections "$plan_section") and then builds
body) to use $'\n\n' immediately after "</summary>" instead of $'\n' so the
generated string includes a blank line between </summary> and the markdown
content; ensure the concatenation that builds body for the Plan: Context &amp;
Architecture details matches the other similar blocks that use $'\n\n'.
- Line 1264: The grep pattern in the match_line assignment uses basic-regex
alternation \(TODO\|Task\) which fails on macOS BSD grep; update the command
that sets match_line to use extended regex (grep -E or egrep) and replace the
BRE alternation with a POSIX ERE group, e.g. use grep -E
"^\*\*(TODO|Task):\*\*.*\b${lookup_id}\b" "$plans_file" so the
lookup_id/plans_file/match_line logic continues to work on macOS.

---

Nitpick comments:
In @.agents/scripts/issue-sync-helper.sh:
- Around line 2858-2880: The debug output in cmd_parse only prints a plan
section when parse_task_line yields an explicit plan_link, which omits plans
auto-detected later by compose_issue_body via find_plan_by_task_id; update
cmd_parse so that if plan_link is empty it attempts the same auto-detect
fallback (call find_plan_by_task_id or compose_issue_body's detection logic) to
set plan_link and then call extract_plan_section/ extract_plan_purpose/
extract_plan_decisions/ extract_plan_progress as before; reference the existing
variables and functions plan_link, parse_task_line, extract_plan_section,
compose_issue_body, and find_plan_by_task_id to mirror the composed-body
behavior and ensure debug output matches what compose_issue_body will produce.
- Around line 1344-1353: The concatenation always prefixes "\n\n" which adds two
leading blank lines when result is empty; fix the loop that builds result (using
the extra_headings loop and _extract_plan_subsection call) so it only prepends
the "\n\n" separator for subsequent sections and not for the first match—i.e.,
check if result is empty before adding the separator and append
"**${heading}**\n\n${content}" for the first match, otherwise use the
"\n\n**${heading}**\n\n${content}" form.
- Around line 1598-1601: The comment above the block that appends the plan ID is
misleading: update the comment near the block that checks detected_plan_id (the
if [[ -n "$detected_plan_id" ]] { ... } section) to state that the plan ID is
included for both auto-detected and explicitly linked plans (since
detected_plan_id is set for explicit links earlier), so replace the "when
auto-detected (no explicit link)" wording with a neutral description like
"include plan ID in metadata header when available."

# Match: **TODO:** t004, t007 OR **Task:** t004
# The task ID must appear as a whole word (not as prefix of another ID)
local match_line match_line_num
match_line=$(grep -n "^\*\*\(TODO\|Task\):\*\*.*\b${lookup_id}\b" "$plans_file" | head -1 || true)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, check the specific line 1264 and surrounding context
sed -n '1260,1270p' .agents/scripts/issue-sync-helper.sh

Repository: marcusquinn/aidevops

Length of output: 554


🏁 Script executed:

# Search for all uses of \| in the script to find similar issues
rg -n '\\\\|' .agents/scripts/issue-sync-helper.sh

Repository: marcusquinn/aidevops

Length of output: 50379


🏁 Script executed:

# Check if the script mentions macOS or BSD compatibility requirements
rg -n -i 'macos|bsd|darwin|brew' .agents/scripts/issue-sync-helper.sh | head -20

Repository: marcusquinn/aidevops

Length of output: 135


🏁 Script executed:

# Verify the complete find_plan_by_task_id function signature and usage
sed -n '1239,1320p' .agents/scripts/issue-sync-helper.sh

Repository: marcusquinn/aidevops

Length of output: 2689


Fix grep portability: \| BRE alternation breaks on macOS BSD grep.

Line 1264 uses basic regex \(TODO\|Task\) which is a GNU extension unsupported by macOS's BSD grep—the command will silently match zero lines. Since this script targets macOS users (brew install gh), this breaks plan auto-detection on the primary platform.

Switch to extended regex mode:

🐛 Proposed fix
-		match_line=$(grep -n "^\*\*\(TODO\|Task\):\*\*.*\b${lookup_id}\b" "$plans_file" | head -1 || true)
+		match_line=$(grep -nE "^\*\*(TODO|Task):\*\*.*\b${lookup_id}\b" "$plans_file" | head -1 || true)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
match_line=$(grep -n "^\*\*\(TODO\|Task\):\*\*.*\b${lookup_id}\b" "$plans_file" | head -1 || true)
match_line=$(grep -nE "^\*\*(TODO|Task):\*\*.*\b${lookup_id}\b" "$plans_file" | head -1 || true)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/issue-sync-helper.sh at line 1264, The grep pattern in the
match_line assignment uses basic-regex alternation \(TODO\|Task\) which fails on
macOS BSD grep; update the command that sets match_line to use extended regex
(grep -E or egrep) and replace the BRE alternation with a POSIX ERE group, e.g.
use grep -E "^\*\*(TODO|Task):\*\*.*\b${lookup_id}\b" "$plans_file" so the
lookup_id/plans_file/match_line logic continues to work on macOS.

Comment on lines +1674 to +1679
# Extra sections: Context, Research, Architecture, Tool Matrix, etc. (collapsed)
local extra_sections
extra_sections=$(extract_plan_extra_sections "$plan_section")
if [[ -n "$extra_sections" ]]; then
body="$body"$'\n\n'"<details><summary>Plan: Context &amp; Architecture</summary>"$'\n'"$extra_sections"$'\n\n'"</details>"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing blank line after </summary> — markdown won't render inside <details> on GitHub.

Lines 1685, 1692, 1699 correctly use $'\n\n' (blank line) after </summary>, but line 1678 uses only $'\n'. GitHub requires a blank line between </summary> and the markdown content for it to render properly. Currently this works by accident because extra_sections starts with \n\n (see earlier comment), but that coupling is fragile.

🐛 Proposed fix
-			body="$body"$'\n\n'"<details><summary>Plan: Context &amp; Architecture</summary>"$'\n'"$extra_sections"$'\n\n'"</details>"
+			body="$body"$'\n\n'"<details><summary>Plan: Context &amp; Architecture</summary>"$'\n\n'"$extra_sections"$'\n\n'"</details>"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/issue-sync-helper.sh around lines 1674 - 1679, The markdown
inside the <details> block is missing a blank line after </summary>, so update
the body construction where extra_sections is appended (the block that sets
extra_sections=$(extract_plan_extra_sections "$plan_section") and then builds
body) to use $'\n\n' immediately after "</summary>" instead of $'\n' so the
generated string includes a blank line between </summary> and the markdown
content; ensure the concatenation that builds body for the Plan: Context &amp;
Architecture details matches the other similar blocks that use $'\n\n'.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces auto-detection of plan references from PLANS.md based on task IDs, which significantly improves the richness of GitHub issue bodies without requiring manual linking. The implementation includes subtask walk-up support and extraction of additional plan sections. My feedback focuses on improving the robustness of task ID matching, reducing code duplication through helper functions, and refining the formatting of extracted sections.

# Match: **TODO:** t004, t007 OR **Task:** t004
# The task ID must appear as a whole word (not as prefix of another ID)
local match_line match_line_num
match_line=$(grep -n "^\*\*\(TODO\|Task\):\*\*.*\b${lookup_id}\b" "$plans_file" | head -1 || true)

Choose a reason for hiding this comment

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

medium

The use of \b for word boundaries in the grep pattern is problematic because . is considered a boundary character. This means that searching for t004 will incorrectly match t004.2, violating the 'whole word' requirement stated in the comment. A more precise boundary check that includes the dot character is needed. Additionally, for robustness when extracting metadata, tail -1 should be preferred over head -1.

Suggested change
match_line=$(grep -n "^\*\*\(TODO\|Task\):\*\*.*\b${lookup_id}\b" "$plans_file" | head -1 || true)
match_line=$(grep -nE "^\*\*(TODO|Task):\*\*.*(^|[^a-zA-Z0-9.])${lookup_id}($|[^a-zA-Z0-9.])" "$plans_file" | tail -1 || true)
References
  1. When extracting metadata fields from a line using 'grep' and 'sed' in shell scripts, use 'tail -1' instead of 'head -1' to ensure robustness, especially when the field might appear multiple times or be at the end of the line.

Comment on lines +1287 to +1299
plan_id=$(awk -v start="$heading_num" '
NR < start { next }
NR > start && /^### / { exit }
/^<!--TOON:plan\{/ {
# Extract first field (plan ID) from TOON data line
getline data_line
if (match(data_line, /^p[0-9]+,/)) {
id = substr(data_line, RSTART, RLENGTH - 1)
print id
exit
}
}
' "$plans_file" || true)

Choose a reason for hiding this comment

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

medium

The logic for extracting a plan ID from a TOON block is duplicated here and in compose_issue_body. It should be extracted into a shared internal helper function to improve maintainability and ensure consistency.

References
  1. Extract repeated logic into an internal helper function to improve maintainability.

local content
content=$(_extract_plan_subsection "$plan_section" "$heading" 0 "true")
if [[ -n "$content" ]]; then
result="${result}"$'\n\n'"**${heading}**"$'\n\n'"${content}"

Choose a reason for hiding this comment

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

medium

The string concatenation here results in leading newlines if result is initially empty. While not critical, it can lead to inconsistent spacing in the final issue body. It's better to only prepend newlines when appending to an existing result.

Suggested change
result="${result}"$'\n\n'"**${heading}**"$'\n\n'"${content}"
if [[ -z "$result" ]]; then result="**${heading}**"$'\n\n'"${content}"; else result="${result}"$'\n\n'"**${heading}**"$'\n\n'"${content}"; fi

Comment on lines +1569 to +1571
detected_plan_id=$(echo "$plan_section" | awk '
/^<!--TOON:plan\{/ { getline data; if (match(data, /^p[0-9]+,/)) { print substr(data, RSTART, RLENGTH-1); exit } }
' || true)

Choose a reason for hiding this comment

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

medium

This awk script duplicates the plan ID extraction logic found in find_plan_by_task_id. As suggested previously, this should be refactored into a helper function.

References
  1. Extract repeated logic into an internal helper function to improve maintainability.

@marcusquinn marcusquinn dismissed coderabbitai[bot]’s stale review February 20, 2026 04:05

Auto-dismissed: bot review does not block autonomous pipeline

@marcusquinn marcusquinn merged commit 9a3002d into main Feb 20, 2026
19 checks passed
@marcusquinn marcusquinn deleted the feature/t1268 branch February 20, 2026 04:21
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