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
feat(safeoutputs): add work-item filing to noop and missing-tool safe outputs (#521)
* feat(safeoutputs): add work-item config for noop and missing-tool safe outputs
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/f7059573-7767-4cc5-b10c-53fac12aa232
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
* fix(safeoutputs): address code review - document WIQL escaping, fix ID handling
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/f7059573-7767-4cc5-b10c-53fac12aa232
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
* feat(safeoutputs): make noop and missing-tool always file/append work items with sensible defaults
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/e309e3af-fbce-4cfe-91d8-420be5233943
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
* retitle defaults
* feat(safe-outputs): auto-assign work items to last committer of agent file
When create-work-item has no explicit assignee configured in front
matter, Stage 3 now falls back to the email of the person who last
committed changes to the agent source markdown file. The lookup uses
git log -1 --format=%ae and degrades gracefully (no assignee set)
when git history is unavailable (e.g. shallow clone).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(safe-outputs): prevent silent config loss in WorkItemReportConfig
WorkItemReportConfig.title was a bare String with no serde default.
When users provided a partial work-item config (e.g. only
work-item-type: Bug), serde deserialization failed and
get_tool_config's unwrap_or_default() silently discarded all
overrides with no error or warning.
Fix: change title to Option<String> with #[serde(default)]. Each
caller (noop, missing-tool) passes its context-specific default
title to file_or_append_work_item, which resolves the effective
title via .unwrap_or(default_title).
Add regression tests for partial work-item configs to both noop
and missing-tool.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(safe-outputs): add missing agent_last_committer field to test ExecutionContext structs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(safe-outputs): address reviewer feedback on work-item filing
- Sanitize agent_last_committer via sanitize_config() to prevent
pipeline command injection from malicious git committer identity
- Add enabled: bool to WorkItemReportConfig (default true) so
operators can opt out of work-item filing with enabled: false
- Add message-content assertions to noop/missing-tool execute tests
- Document serde-default layering quirk for title: None in partial
work-item configs
- Document --follow trade-off in discover_last_committer
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(safe-outputs): tighten test assertions and add HTTP client timeout
- Assert is_warning() and tighten message match to 'not set' in
execute.rs noop/missing-tool integration tests
- Add 30s timeout to reqwest client in file_or_append_work_item
to prevent indefinite hangs on slow/unreachable ADO endpoints
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor(safe-outputs): rename agent_last_committer to agent_last_author
git log --format=%ae returns the author email, not the committer
email. In squash-merge workflows the committer is typically a
service account (e.g. GitHub noreply) while the author is the
PR author — which is the meaningful value for assignee fallback.
Rename discover_last_committer -> discover_last_author and
agent_last_committer -> agent_last_author throughout, with
updated doc comments explaining the %ae vs %ce distinction.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Co-authored-by: James Devine <devinejames@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/safe-outputs.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ Creates an Azure DevOps work item.
71
71
- `work-item-type` - Work item type (default: "Task")
72
72
- `area-path`- Area path for the work item
73
73
- `iteration-path`- Iteration path for the work item
74
-
- `assignee`- User to assign (email or display name)
74
+
- `assignee`- User to assign (email or display name). When omitted, falls back to the email of the last person who committed changes to the agent source markdown file (discovered via `git log` at Stage 3).
75
75
- `tags`- Static list of tags always applied to the work item (regardless of agent input)
76
76
- `allowed-tags`- Allowlist of tags the agent is permitted to use via the `tags` parameter. If empty, any agent-provided tags are accepted. Supports `*` wildcards anywhere in the pattern (e.g., `"agent-*"` matches `"agent-created"`; `"copilot:repo=org/project/*@main"` matches any repo name).
77
77
- `custom-fields` - Map of custom field reference names to values (e.g., `Custom.MyField: "value"`)
@@ -199,9 +199,28 @@ The `repository` value must be `"self"`, an alias from the `checkout:` list in t
199
199
### noop
200
200
Reports that no action was needed. Use this to provide visibility when analysis is complete but no changes or outputs are required.
201
201
202
+
The executor always files an Azure DevOps work item or appends a comment to an existing one. Override the defaults in front matter to customise the title, type, or area path. If ADO credentials are not available the tool succeeds with a warning.
203
+
202
204
**Agent parameters:**
203
205
-`context` - Optional context about why no action was taken
204
206
207
+
**Configuration options (front matter):**
208
+
```yaml
209
+
safe-outputs:
210
+
noop:
211
+
work-item: # Work item config — always active with these defaults
212
+
enabled: true # Set to false to disable work-item filing entirely
213
+
title: "[ado-aw] Agent reported no operation"# Default title (used to find existing items too)
214
+
work-item-type: Task # Work item type (default: "Task")
215
+
area-path: "MyProject\\MyTeam"# Optional — area path
include-stats: true # Append agent stats to description/comment (default: true)
220
+
```
221
+
222
+
The executor searches for a non-closed work item with the same `title` in the project. If one is found, a comment is appended; otherwise a new work item is created.
223
+
205
224
### missing-data
206
225
Reports that data or information needed to complete the task is not available.
207
226
@@ -213,10 +232,29 @@ Reports that data or information needed to complete the task is not available.
213
232
### missing-tool
214
233
Reports that a tool or capability needed to complete the task is not available.
215
234
235
+
The executor always files an Azure DevOps work item or appends a comment to an existing one. Override the defaults in front matter to customise the title, type, or area path. If ADO credentials are not available the tool succeeds with a warning.
236
+
216
237
**Agent parameters:**
217
238
- `tool_name`- Name of the tool that was expected but not found
218
239
- `context`- Optional context about why the tool was needed
219
240
241
+
**Configuration options (front matter):**
242
+
```yaml
243
+
safe-outputs:
244
+
missing-tool:
245
+
work-item: # Work item config — always active with these defaults
246
+
enabled: true # Set to false to disable work-item filing entirely
247
+
title: "[ado-aw] Agent encountered missing tool" # Default title (used to find existing items too)
248
+
work-item-type: Task # Work item type (default: "Task")
249
+
area-path: "MyProject\\MyTeam" # Optional — area path
include-stats: true # Append agent stats to description/comment (default: true)
254
+
```
255
+
256
+
The executor searches for a non-closed work item with the same `title` in the project. If one is found, a comment is appended; otherwise a new work item is created.
0 commit comments