diff --git a/docs/agents/triage.md b/docs/agents/triage.md index 55b191ec0c..aa526068a7 100644 --- a/docs/agents/triage.md +++ b/docs/agents/triage.md @@ -41,6 +41,7 @@ outcome and the post-script applies the corresponding label. | `triaged` | The issue is fully specified but is a feature or other category that requires human prioritization before coding. | | `duplicate` | The issue duplicates an existing one. The agent identified the original and the post-script closes the issue. | | `blocked` | The issue depends on another issue or external condition. The agent identified the blocker. | +| `question` | The issue is a support request or question, not an actionable bug or feature. The agent attempted to answer it. | The `issue-labels` skill may also apply contextual labels (e.g., `area/api`, `kind/bug`) but these are informational — they do not control agent behavior. @@ -79,7 +80,7 @@ invent labels or apply labels not listed here. ## Control labels (never recommend these) These are managed by the triage pipeline. Never include them in `label_actions`: -`needs-info`, `ready-to-code`, `duplicate`, `blocked`, `triaged`. +`needs-info`, `ready-to-code`, `duplicate`, `blocked`, `triaged`, `question`. ## Area labels diff --git a/internal/scaffold/fullsend-repo/agents/triage.md b/internal/scaffold/fullsend-repo/agents/triage.md index 9d28b08124..c71b3c12f5 100644 --- a/internal/scaffold/fullsend-repo/agents/triage.md +++ b/internal/scaffold/fullsend-repo/agents/triage.md @@ -95,6 +95,7 @@ Use this phased approach to evaluate the issue: - What component or feature is affected? - Is this a regression, new bug, or misunderstanding? - Is there any version or timeline information? +- **Is this a question?** If the issue is asking for information rather than reporting a defect or requesting a change, use the `question` action instead of proceeding to deeper investigation. Questions typically use interrogative phrasing and describe no concrete problem or desired behavior change. ### Phase 2 — Deep investigation - Are exact error messages or logs provided? @@ -127,6 +128,25 @@ Calculate overall clarity: `symptom*0.35 + cause*0.30 + reproduction*0.20 + impa Based on your assessment, choose exactly one action and write the result as JSON to `$FULLSEND_OUTPUT_DIR/agent-result.json`. +### Action: `question` + +The issue is a support request or question rather than a bug report, feature request, or other actionable work item. The reporter is asking for information, not requesting a change. + +Detect question-style issues by looking for: +- Interrogative phrasing ("Why don't we…?", "Does X support…?", "How do I…?") +- No described defect, missing feature, or requested change +- The reporter seeking to understand existing behavior rather than change it + +When you identify a question, attempt to answer it using the repository context gathered in Step 2. Then ask the reporter whether the question has been answered or whether they want to convert the issue into a feature request. + +```json +{ + "action": "question", + "reasoning": "Brief explanation of why this is a question rather than a bug or feature request", + "comment": "Your answer to the question, followed by a prompt asking whether the reporter wants to convert this into a feature request or close the issue. Be helpful and specific — use repository context to give a substantive answer rather than a generic response." +} +``` + ### Action: `insufficient` Information is missing that would change the triage outcome. Ask ONE focused, specific clarifying question. diff --git a/internal/scaffold/fullsend-repo/schemas/triage-result.schema.json b/internal/scaffold/fullsend-repo/schemas/triage-result.schema.json index 699eea0c02..a80948d309 100644 --- a/internal/scaffold/fullsend-repo/schemas/triage-result.schema.json +++ b/internal/scaffold/fullsend-repo/schemas/triage-result.schema.json @@ -9,7 +9,7 @@ "properties": { "action": { "type": "string", - "enum": ["insufficient", "duplicate", "sufficient", "blocked"] + "enum": ["insufficient", "duplicate", "sufficient", "blocked", "question"] }, "reasoning": { "type": "string", diff --git a/internal/scaffold/fullsend-repo/scripts/post-triage-test.sh b/internal/scaffold/fullsend-repo/scripts/post-triage-test.sh index 65d919e04d..ebed3908ab 100755 --- a/internal/scaffold/fullsend-repo/scripts/post-triage-test.sh +++ b/internal/scaffold/fullsend-repo/scripts/post-triage-test.sh @@ -217,6 +217,31 @@ run_test "blocked-missing-comment-fails" \ "" \ "true" +run_test "question-posts-comment" \ + '{"action":"question","reasoning":"issue is asking a question","comment":"Based on the repository docs, Python 4 is not currently supported.\n\nDid this answer your question, or would you like to open a feature request for Python 4 support?"}' \ + "gh issue comment 42 --repo test-org/test-repo --body-file -" + +run_test "question-applies-question-label" \ + '{"action":"question","reasoning":"issue is asking a question","comment":"Based on the repository docs, Python 4 is not currently supported.\n\nDid this answer your question, or would you like to open a feature request for Python 4 support?"}' \ + "gh api repos/test-org/test-repo/issues/42/labels -f labels[]=question --silent" + +run_test "question-removes-blocked-label" \ + '{"action":"question","reasoning":"issue is asking a question","comment":"Based on the repository docs, Python 4 is not currently supported."}' \ + "gh api repos/test-org/test-repo/issues/42/labels/blocked -X DELETE --silent" + +run_test "question-removes-needs-info-label" \ + '{"action":"question","reasoning":"issue is asking a question","comment":"Based on the repository docs, Python 4 is not currently supported."}' \ + "gh api repos/test-org/test-repo/issues/42/labels/needs-info -X DELETE --silent" + +run_test "question-missing-comment-fails" \ + '{"action":"question","reasoning":"issue is asking a question"}' \ + "" \ + "true" + +run_test_stdout "question-control-label-refused" \ + '{"action":"question","reasoning":"issue is asking a question","comment":"Answer here.","label_actions":{"reason":"Tried to set question label.","actions":[{"action":"add","label":"question"}]}}' \ + "::warning::Refused to add control label 'question' -- control labels are managed by the triage pipeline" + run_test "unknown-action-fails" \ '{"action":"not_a_bug","reasoning":"working as intended","comment":"This is working as intended."}' \ "" \ diff --git a/internal/scaffold/fullsend-repo/scripts/post-triage.sh b/internal/scaffold/fullsend-repo/scripts/post-triage.sh index 8a25baa09c..6e9dc18f95 100755 --- a/internal/scaffold/fullsend-repo/scripts/post-triage.sh +++ b/internal/scaffold/fullsend-repo/scripts/post-triage.sh @@ -74,9 +74,9 @@ remove_label() { # Control labels managed by the triage pipeline. The post script refuses to # add or remove these via label_actions. This list covers labels that the -# pipeline itself applies (pre-triage.sh resets the first four; the action +# pipeline itself applies (pre-triage.sh resets the first five; the action # handlers apply blocked/triaged/feature). -CONTROL_LABELS=("needs-info" "ready-to-code" "duplicate" "feature" "blocked" "triaged") +CONTROL_LABELS=("needs-info" "ready-to-code" "duplicate" "feature" "blocked" "triaged" "question") is_control_label() { local label="$1" @@ -180,6 +180,16 @@ case "${ACTION}" in esac ;; + question) + if [[ -z "${COMMENT}" ]]; then + echo "ERROR: action is 'question' but no comment provided" + exit 1 + fi + remove_label "blocked" + remove_label "needs-info" + add_label "question" + ;; + *) echo "ERROR: unknown action '${ACTION}' — this may be a newer action that post-triage.sh does not handle yet" exit 1 diff --git a/internal/scaffold/fullsend-repo/scripts/pre-triage.sh b/internal/scaffold/fullsend-repo/scripts/pre-triage.sh index f046f40f9a..d6f4c108fe 100755 --- a/internal/scaffold/fullsend-repo/scripts/pre-triage.sh +++ b/internal/scaffold/fullsend-repo/scripts/pre-triage.sh @@ -27,13 +27,13 @@ ISSUE_NUMBER=$(basename "${GITHUB_ISSUE_URL}") echo "Resetting triage labels on ${REPO}#${ISSUE_NUMBER}" -for label in needs-info ready-to-code duplicate feature; do +for label in needs-info ready-to-code duplicate feature question; do gh api "repos/${REPO}/issues/${ISSUE_NUMBER}/labels/${label}" -X DELETE --silent 2>/dev/null || true done # Verify no triage labels remain — the pipeline depends on mutual exclusivity. REMAINING=$(gh api "repos/${REPO}/issues/${ISSUE_NUMBER}/labels" \ - --jq '[.[] | select(.name == "needs-info" or .name == "ready-to-code" or .name == "duplicate" or .name == "feature") | .name] | join(", ")' 2>/dev/null || echo "VERIFY_FAILED") + --jq '[.[] | select(.name == "needs-info" or .name == "ready-to-code" or .name == "duplicate" or .name == "feature" or .name == "question") | .name] | join(", ")' 2>/dev/null || echo "VERIFY_FAILED") if [[ "${REMAINING}" == "VERIFY_FAILED" ]]; then echo "ERROR: cannot verify label state — API call failed" diff --git a/internal/scaffold/fullsend-repo/scripts/validate-output-schema-test.sh b/internal/scaffold/fullsend-repo/scripts/validate-output-schema-test.sh index 88baccbbc4..6c43fe0442 100755 --- a/internal/scaffold/fullsend-repo/scripts/validate-output-schema-test.sh +++ b/internal/scaffold/fullsend-repo/scripts/validate-output-schema-test.sh @@ -66,6 +66,10 @@ run_test "valid-duplicate" \ '{"action":"duplicate","reasoning":"same as #10","duplicate_of":10,"comment":"Duplicate of #10."}' \ "true" +run_test "valid-question" \ + '{"action":"question","reasoning":"this is a support question","comment":"Based on the docs, Python 4 is not supported. Would you like to open a feature request?"}' \ + "true" + run_test "valid-blocked-issue" \ '{"action":"blocked","reasoning":"upstream dependency","blocked_by":"https://github.com/org/repo/issues/99","comment":"Blocked on upstream."}' \ "true"