mirror of
https://github.com/Hmbown/DeepSeek-TUI.git
synced 2026-09-03 06:50:13 +08:00
Two auto-labellers were classifying issues from their full body text, which meant the better-specified an issue was, the more wrong labels it collected. The v0.9.2 localization issues (#4787, #4790) landed tagged `bug, question` purely because their acceptance criteria said "fails when a pack drifts" and a scope heading said "How to add a locale". triage.yml: match type labels against the title only. A title states what an issue *is*; a body just discusses it. Also drop `error` and `fail(ed|ure)` from the bug rule outright — they describe what nearly every issue mentions, not what any issue is. This trades a little recall for precision: a genuine bug whose title avoids the word "bug" now needs manual triage, which is the cheaper error. agent-task-labels.yml: `tui` required only a bare \btui\b, so any issue that referenced the terminal UI in passing was tagged as touching it. Anchor on `crates/tui`, `ratatui`, and `codewhale-tui` instead. Those signals are also the ones that survive the single-binary refactor (#4747): the crate path and the framework stay when codewhale-tui is lib-ized, while the binary name goes away. Verified against the four issues that misfired: `bug` and `question` clear on all of them, `tui` is retained where the body genuinely cites crates/tui, a synthetic "Crash on startup: panic in ratatui render loop" still classifies as bug+tui, and a passing "how the tui differs from the web UI" mention no longer fires.
67 lines
2.7 KiB
YAML
67 lines
2.7 KiB
YAML
name: Agent task labels
|
|
|
|
on:
|
|
issues:
|
|
types: [opened]
|
|
|
|
permissions:
|
|
issues: write
|
|
contents: read
|
|
|
|
jobs:
|
|
labels:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Add area hints to agent tasks
|
|
uses: actions/github-script@v9
|
|
with:
|
|
script: |
|
|
const issue = context.payload.issue;
|
|
if (!issue) return;
|
|
|
|
const labels = new Set((issue.labels || []).map(label => label.name));
|
|
if (!labels.has('agent-ready')) {
|
|
core.info(`#${issue.number} is not an agent task; leaving it unchanged.`);
|
|
return;
|
|
}
|
|
|
|
// Milestones are the canonical release roadmap and are assigned
|
|
// explicitly during triage. Never infer one from a title or label:
|
|
// old version labels must remain harmless historical metadata.
|
|
const title = (issue.title || '').toLowerCase();
|
|
const body = (issue.body || '').toLowerCase();
|
|
const text = `${title}\n${body}`;
|
|
|
|
if (/\bworkflow\b|whaleflow|workflow-runtime/.test(text)) labels.add('workflow-runtime');
|
|
// `tui` means "touches the terminal UI layer", not "mentions the TUI
|
|
// in passing". A bare \btui\b over-fired on every issue that merely
|
|
// referenced the UI — the v0.9.2 localization issues all describe TUI
|
|
// locale packs in prose and were labelled on that alone.
|
|
//
|
|
// Anchor on signals that survive the single-binary refactor (#4747):
|
|
// the crate path and the rendering framework stay put when
|
|
// codewhale-tui is lib-ized, whereas the `codewhale-tui` *binary*
|
|
// name goes away. Do not reintroduce a bare word match here.
|
|
if (/crates\/tui\b|ratatui|\bcodewhale-tui\b/.test(text)) labels.add('tui');
|
|
if (/fleet|subagent|sub-agent/.test(text)) labels.add('subagents');
|
|
if (/catalog|openrouter|model.?picker|provider.?lake/.test(text)) labels.add('reliability');
|
|
|
|
const existing = await github.paginate(github.rest.issues.listLabelsForRepo, {
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
per_page: 100,
|
|
});
|
|
const existingNames = new Set(existing.map(label => label.name));
|
|
const currentNames = new Set((issue.labels || []).map(label => label.name));
|
|
const toAdd = [...labels].filter(
|
|
name => existingNames.has(name) && !currentNames.has(name)
|
|
);
|
|
if (toAdd.length === 0) return;
|
|
|
|
await github.rest.issues.addLabels({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: issue.number,
|
|
labels: toAdd,
|
|
});
|