AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. ai-agents-sde
  4. gh-1544
  5. plan
  6. context.json
context.json(3.6 KB)· Apr 2, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "1544",
    "title": "Fix shell quoting bug in tech-sweep-exec inline comment posting",
    "created_at": "2026-04-02T12:00:00Z"
  },
  "inputs": [
    {
      "name": "issue-1544",
      "type": "context",
      "ref": "https://github.com/AgentSDE/ai-agents-sde/issues/1544",
      "notes": "Shell quoting bug in tech-sweep-exec when posting inline PR comments with multi-line bodies"
    },
    {
      "name": "tech-sweep-exec-skill",
      "type": "file",
      "ref": ".openclaw/workspace/skills/tech-sweep-exec/SKILL.md",
      "notes": "Current skill using -f body='<text>' pattern that breaks on newlines/quotes"
    },
    {
      "name": "post-review-reference",
      "type": "file",
      "ref": "scripts/tools/post-review.sh",
      "notes": "Existing safe pattern using jq + --input for JSON payload construction"
    }
  ],
  "outputs": [
    {
      "name": "plan",
      "type": "plan",
      "format": "md",
      "content": "plan.md"
    }
  ],
  "files": [
    {
      "path": ".openclaw/workspace/skills/tech-sweep-exec/SKILL.md",
      "action": "modify",
      "reason": "Replace unsafe -f body='<text>' with jq + --input - pattern; update failure behavior to log-and-continue"
    },
    {
      "path": "scripts/tools/post-inline-comment.sh",
      "action": "create",
      "reason": "Reusable helper for safe inline PR comment posting via JSON construction"
    },
    {
      "path": "scripts/tools/test-inline-comment-quoting.sh",
      "action": "create",
      "reason": "Regression test for tricky character handling in comment bodies"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Create post-inline-comment.sh helper script using jq + gh api --input - pattern",
      "acceptance": [
        "Script accepts --repo, --pr, --commit, --path, --line, --body-file args",
        "Constructs JSON payload via jq -n --arg and posts via gh api --input -",
        "Exits non-zero with logged error on API failure",
        "Follows post-review.sh conventions (set -euo pipefail, log functions, tmp cleanup)"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Update tech-sweep-exec SKILL.md to use safe quoting and log-and-continue on inline failures",
      "acceptance": [
        "Inline comment API section replaced with jq + --input - or post-inline-comment.sh reference",
        "No -f body='<text>' pattern remains for multi-line strings",
        "Failure behavior updated: inline POST failure logs error and continues remaining actions",
        "Top-level review still posts before inline comments"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Create regression test script exercising tricky character handling",
      "acceptance": [
        "Test constructs a payload body with newlines, double-quotes, and a backtick",
        "Validates JSON is well-formed via jq",
        "Dry-run mode (default) requires no GitHub API access",
        "Optional --live flag posts to a real PR for manual verification"
      ],
      "depends_on": [
        "S1"
      ]
    }
  ],
  "risks": [
    {
      "risk": "Skill SKILL.md is prompt-level instructions — changes take effect on next agent invocation without deployment",
      "mitigation": "Test the updated instructions with a manual sweep run before the next scheduled cycle"
    },
    {
      "risk": "post-inline-comment.sh must be present on runner filesystem before SKILL.md references it",
      "mitigation": "Deploy script first (S1), then update skill (S2)"
    }
  ],
  "assumptions": [
    "The tech-sweep-exec skill is invoked by Claude Code reading .openclaw/workspace/skills/tech-sweep-exec/SKILL.md",
    "The runner environment has jq and gh CLI available",
    "scripts/tools/ is the correct location for new shell tool scripts per AGENTS.md"
  ],
  "open_questions": []
}
Plan