Fix shell quoting bug in tech-sweep-exec inline comment posting#
Problem#
Inline PR comments posted by tech-sweep-exec broke when the comment body contained newlines, double-quotes, or backticks. The root cause was using -f body='<text>' in gh api calls, which is not safe for multi-line or special-character strings.
Task / Link#
Closes #1544
Changes#
- Created
scripts/tools/post-inline-comment.sh: reusable helper that constructs JSON viajq -n --argand posts viagh api --input -(mirrorspost-review.shpattern) - Updated
tech-sweep-exec/SKILL.md: replaced unsafe-f body='<text>'pattern withpost-inline-comment.shreference and directjq + --input -alternative - Updated failure behavior in SKILL.md: inline POST failures now log-and-continue instead of halting all remaining actions
- Created
scripts/tools/test-inline-comment-quoting.sh: dry-run regression test validating JSON construction with newlines, double-quotes, and backticks; supports--liveflag for real API verification
Notes#
- SKILL.md is a prompt-level instruction file — changes take effect on the next agent invocation (no deployment required)
post-inline-comment.shmust exist on the runner filesystem before the SKILL.md references it; S1 (script creation) was deployed before S2 (skill update)
Testing#
- Ran
test-inline-comment-quoting.shin dry-run mode — all 4 checks passed (well-formed JSON, double-quotes preserved, backticks preserved, newlines preserved) - Manual live verification can be performed with
--live --repo AgentSDE/ai-agents-sde --pr <pr_number> --commit <sha> --path <file> --line <line>