feat(issues): gitea_issue_create cannot set labels, assignee or milestone #6

Closed
opened 2026-10-23 17:17:54 +00:00 by dsh · 1 comment
Owner

Symptom

gitea_issue_create cannot attach labels — nor assignee or milestone — at creation. An extra labels: ["type/bug"] argument is silently dropped and the issue opens unlabeled. The workaround is create-then-gitea_labels {action:"set"} with numeric ids, which is two calls and one chance to forget.

Observed 2026-10-23 on dsh-plugins/dsh-gitea and pvlb-infra/issue-tracker.

Root cause

// lib/handlers/issues.js:104
case 'gitea_issue_create':
  return wrap(await client.createIssue(owner, repo, {
    title: args.title,
    body: args.body,
  }))

Only two fields are forwarded. The tool definition does not declare labels, assignee or milestone either, so the harness discards them before the handler runs. This is a feature gap, not a formatter bug.

Fix

  1. Extend the gitea_issue_create tool definition with labels (array), assignee (string), milestone (number) and confirm-free optional fields.
  2. In the handler, forward them; for labels, accept numeric ids and optionally resolve names against listLabels (case-insensitive), failing loudly on an unknown name instead of dropping it.
  3. Echo the result: #42 opened with labels [type/bug, area/forgejo].

Acceptance

  • creating with labels in one call yields a labeled issue.
  • unknown label name → error, not a silently unlabeled issue.
  • assignee/milestone accepted.
## Symptom `gitea_issue_create` cannot attach labels — nor assignee or milestone — at creation. An extra `labels: ["type/bug"]` argument is silently dropped and the issue opens unlabeled. The workaround is create-then-`gitea_labels {action:"set"}` with numeric ids, which is two calls and one chance to forget. Observed 2026-10-23 on `dsh-plugins/dsh-gitea` and `pvlb-infra/issue-tracker`. ## Root cause ```js // lib/handlers/issues.js:104 case 'gitea_issue_create': return wrap(await client.createIssue(owner, repo, { title: args.title, body: args.body, })) ``` Only two fields are forwarded. The tool definition does not declare `labels`, `assignee` or `milestone` either, so the harness discards them before the handler runs. This is a **feature gap**, not a formatter bug. ## Fix 1. Extend the `gitea_issue_create` tool definition with `labels` (array), `assignee` (string), `milestone` (number) and `confirm`-free optional fields. 2. In the handler, forward them; for `labels`, accept numeric ids and optionally resolve names against `listLabels` (case-insensitive), failing loudly on an unknown name instead of dropping it. 3. Echo the result: `#42 opened with labels [type/bug, area/forgejo]`. ## Acceptance - [ ] creating with labels in one call yields a labeled issue. - [ ] unknown label name → error, not a silently unlabeled issue. - [ ] assignee/milestone accepted.
dsh closed this issue 2026-10-23 22:54:42 +00:00
Author
Owner

Fixed in 6941048 (PR #17).

gitea_issue_create now declares and forwards labels, assignee and milestone. Label names are resolved case-insensitively against listLabels, numeric ids pass through, order is preserved and duplicates collapse. An unknown name fails the call before creating anything; a non-numeric milestone is rejected. The echo shows what was attached.

Live on ml-lab/tardits:

  • labels: ["TYPE/BUG", "does-not-exist"] → unknown label name(s): does-not-exist. Create them first or pass numeric ids. (no issue created)
  • labels: ["TYPE/BUG"], assignee: "dsh", milestone: 2 → #1 "probe: create with labels/assignee/milestone (#6)" opened with labels [type/bug] assigned to @dsh milestone #2 (Probe #6)
  • Probe issue #1 closed and milestone #2 deleted; the house type/bug label remains on the lab repo.

Tests: test/issue-create.test.mjs; npm test 74/74.

Fixed in `6941048` (PR #17). `gitea_issue_create` now declares and forwards `labels`, `assignee` and `milestone`. Label names are resolved case-insensitively against `listLabels`, numeric ids pass through, order is preserved and duplicates collapse. An unknown name fails the call before creating anything; a non-numeric milestone is rejected. The echo shows what was attached. Live on `ml-lab/tardits`: - `labels: ["TYPE/BUG", "does-not-exist"]` → `unknown label name(s): does-not-exist. Create them first or pass numeric ids.` (no issue created) - `labels: ["TYPE/BUG"], assignee: "dsh", milestone: 2` → `#1 "probe: create with labels/assignee/milestone (#6)" opened with labels [type/bug] assigned to @dsh milestone #2 (Probe #6)` - Probe issue #1 closed and milestone #2 deleted; the house `type/bug` label remains on the lab repo. Tests: `test/issue-create.test.mjs`; `npm test` 74/74.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
dsh-plugins/dsh-gitea#6
No description provided.