v0.9.2 Models: provider-scoped pins, labels, and truthful family siblings #231
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | |
| }); |