You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new safe output tool that allows agents to comment on existing
Azure DevOps work items. This is the ADO equivalent of gh-aw's
add-comment tool.
Features:
- Agent provides work_item_id and body (markdown comment text)
- Required 'target' field in frontmatter scopes which work items
can be commented on: wildcard, specific ID(s), or area path prefix
- max field (default: 1) limits comments per run
- Area path targets validated via ADO API at Stage 2
- Compile-time validation ensures target is specified
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ Alongside the correctly generated pipeline yaml, an agent file is generated from
39
39
│ ├── sanitize.rs # Input sanitization for safe outputs
40
40
│ └── tools/ # MCP tool implementations
41
41
│ ├── mod.rs
42
+
│ ├── comment_on_work_item.rs
42
43
│ ├── create_pr.rs
43
44
│ ├── create_wiki_page.rs
44
45
│ ├── create_work_item.rs
@@ -759,6 +760,31 @@ Safe output configurations are passed to Stage 2 execution and used when process
759
760
760
761
### Available Safe Output Tools
761
762
763
+
#### comment-on-work-item
764
+
Adds a comment to an existing Azure DevOps work item. This is the ADO equivalent of gh-aw's `add-comment` tool.
765
+
766
+
**Agent parameters:**
767
+
- `work_item_id`- The work item ID to comment on (required, must be positive)
768
+
- `body`- Comment text in markdown format (required, must be at least 10 characters)
769
+
770
+
**Configuration options (front matter):**
771
+
- `max` - Maximum number of comments per run (default: 1)
772
+
- `target` - **Required** — scoping policy for which work items can be commented on:
773
+
- `"*"`- Any work item in the project (unrestricted, must be explicit)
774
+
- `12345`- A specific work item ID
775
+
- `[12345, 67890]`- A list of allowed work item IDs
776
+
- `"area:Some\\Path"`- Work items under the specified area path prefix (validated via ADO API at Stage 2)
777
+
778
+
**Example configuration:**
779
+
```yaml
780
+
safe-outputs:
781
+
comment-on-work-item:
782
+
max: 3
783
+
target: "area:4x4\\QED"
784
+
```
785
+
786
+
**Note:** The `target` field is required. If omitted, compilation fails with an error. This ensures operators are intentional about which work items agents can comment on.
"Comment queued for work item #{}. The comment will be posted during safe output processing.",
370
+
result.work_item_id
371
+
))]))
372
+
}
373
+
338
374
#[tool(
339
375
name = "create-pull-request",
340
376
description = "Create a new pull request to propose code changes. Use this after making file edits to submit them for review and merging. The PR will be created from the current branch with your committed changes. Use 'self' for the pipeline's own repository, or a repository alias from the checkout list."
0 commit comments