Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/agents/triage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 20 additions & 0 deletions internal/scaffold/fullsend-repo/agents/triage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"properties": {
"action": {
"type": "string",
"enum": ["insufficient", "duplicate", "sufficient", "blocked"]
"enum": ["insufficient", "duplicate", "sufficient", "blocked", "question"]
},
"reasoning": {
"type": "string",
Expand Down
25 changes: 25 additions & 0 deletions internal/scaffold/fullsend-repo/scripts/post-triage-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."}' \
"" \
Expand Down
12 changes: 11 additions & 1 deletion internal/scaffold/fullsend-repo/scripts/post-triage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ remove_label() {
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] stale-doc

Comment says 'pre-triage.sh resets the first four' but pre-triage now resets 5 labels (with question added to the reset loop). The ordinal reference is no longer accurate.

Suggested fix: Update the comment to reflect the current count of labels reset by pre-triage.sh.

# 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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/scaffold/fullsend-repo/scripts/pre-triage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading