Skip to content

feat(triage): surface open sub-issues in triage evaluation#147

Merged
keinstn merged 3 commits into
developfrom
agent/keinstn__baton-143
Jun 24, 2026
Merged

feat(triage): surface open sub-issues in triage evaluation#147
keinstn merged 3 commits into
developfrom
agent/keinstn__baton-143

Conversation

@keinstn

@keinstn keinstn commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Introduces TriageIssue (extends Issue) with an openSubIssues: SubIssueRef[] field in scripts/triage/fetcher.tssrc/tracker/types.ts is untouched
  • fetchAndGroup now fetches open sub-issues per issue via GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues (GitHub REST API) in parallel, filtering to only state: "open" items
  • Updates Evaluator.evaluate, renderPrompt, and both adapter implementations (claude-eval.ts, copilot-eval.ts) to accept TriageIssue[]
  • Adds an **Open sub-issues (N):** line to the examples/TRIAGE.md prompt template after the existing **Blocked by:** line
  • Adds tests covering: sub-issue attachment, closed-sub-issue filtering, REST error fallback to empty, Authorization header presence, and renderPrompt rendering with 0/1/many open sub-issues

Closes #143

Test plan

  • npm run test — 330 tests pass
  • npm run typecheck — no errors
  • npm run lint — no errors
  • Tracking issue with open sub-issues renders them in renderPrompt output (see renderPrompt — openSubIssues test suite)
  • Tracking issue with no open sub-issues renders none
  • TriageIssue defined in scripts/triage/fetcher.ts; Issue in src/tracker/types.ts unchanged
  • blockedBy not used for sub-issue data anywhere

🤖 Generated with Claude Code

- Add `TriageIssue` (extends `Issue`) with `openSubIssues` field in fetcher.ts
- Fetch open sub-issues per issue via GitHub REST API in `fetchAndGroup`
- Update `Evaluator.evaluate` and `renderPrompt` to accept `TriageIssue[]`
- Update evaluator adapters (claude-eval, copilot-eval) accordingly
- Add openSubIssues rendering to examples/TRIAGE.md prompt template
- Add tests for sub-issue fetching, filtering, and prompt rendering

Closes #143

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@keinstn

keinstn commented Jun 24, 2026

Copy link
Copy Markdown
Owner Author

[Baton Reviewer] Review result: pass — no actionable issues found; ready for human review.
Managed by Baton; do not edit the marker line manually.

@keinstn keinstn self-assigned this Jun 24, 2026
Comment thread scripts/triage/fetcher.ts Outdated
Comment thread scripts/triage/fetcher.ts Outdated
Comment thread scripts/triage/fetcher.ts Outdated
Comment thread scripts/triage/fetcher.ts Outdated
keinstn and others added 2 commits June 24, 2026 21:53
…, and missing pages

- Wrap resp.json() in try/catch so a non-JSON body (e.g. proxy HTML error
  page on a 200 response) returns [] instead of crashing the whole triage run
- Fix REST base URL derivation for GHES: /api/graphql → /api/v3 (was
  /api/graphql → /api, missing the /v3 segment, causing silent 404s)
- Follow Link response header to paginate sub-issues beyond the first page
  (GitHub defaults to 30/page; now requests 100/page and follows rel="next")
- Process sub-issue requests sequentially instead of concurrent Promise.all
  to avoid GitHub secondary rate-limit 429s on large boards

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@keinstn
keinstn merged commit 3f50f6b into develop Jun 24, 2026
4 checks passed
@keinstn
keinstn deleted the agent/keinstn__baton-143 branch June 24, 2026 12:59
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.

feat(triage): surface open sub-issues in triage evaluation

1 participant