feat(safeoutputs): add work-item filing to noop and missing-tool safe outputs#521
Conversation
…e 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>
…D 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>
|
@copilot implement sensible defaults for the workitem. These safeoutputs always should now create or append to a work item. |
… 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>
Done in d0257b8. Both tools now always file or append to a work item with no config required:
The Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
🔍 Rust PR ReviewSummary: Has one correctness bug (silent config loss) that should be fixed before merge; everything else looks solid. Findings🐛 Bugs / Logic Issues
|
… 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>
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>
🔍 Rust PR ReviewSummary: Has one meaningful bug that breaks the stated design guarantee — the "never blocks the pipeline" promise is violated in HTTP error paths. Findings🐛 Bugs / Logic Issues
|
🔍 Rust PR ReviewSummary: Looks good overall — the feature is well-structured and the graceful-degradation path is a solid design choice. Two findings worth addressing before merge. Findings🐛 Bugs / Logic Issues
|
…cutionContext structs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Has one unsanitized-input security concern and a no-opt-out breaking behavioral change worth discussing before merge. Findings🔒 Security Concerns
🐛 Bugs / Logic Issues
|
- 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>
🔍 Rust PR ReviewSummary: Looks good overall — solid implementation with correct security handling. Two concerns worth addressing before merge: a silent breaking behavioral change and a missing HTTP timeout. Findings🐛 Bugs / Logic Issues
|
- 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>
🔍 Rust PR ReviewSummary: Looks good with one naming/documentation bug and one design trade-off worth discussing. Findings🐛 Bugs / Logic Issues
|
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>
🔍 Rust PR ReviewSummary: Looks good overall — the design is sound and security hygiene is solid. Two issues worth fixing before merge. Findings🐛 Bugs / Logic Issues
✅ What Looks Good
|
Adds work-item filing behaviour to
noopandmissing-toolsafe outputs. The Stage 3 executor always files an Azure DevOps work item or appends a comment to an existing one when these diagnostic tools are invoked. All fields have sensible defaults so no front-matter configuration is required.Summary
src/safeoutputs/mod.rs— shared infrastructure:WorkItemReportConfig: configures title, work-item-type, area/iteration paths, tags, and stats inclusionwiql_find_work_item_by_title(): WIQL search for a non-closed item matching the configured titlefile_or_append_work_item(): comment on existing item if found; create new one otherwise. Returns a warning (not a failure) when ADO credentials are absent or the WIQL call fails, so these always-on tools never block the pipelinesrc/safeoutputs/noop.rs—NoopConfigwith awork_item: WorkItemReportConfigfield that defaults to a Task titled"Agent reported no operation"; executor always calls the shared helpersrc/safeoutputs/missing_tool.rs—MissingToolConfigwith awork_item: WorkItemReportConfigfield that defaults to a Task titled"Agent encountered missing tool"; executor always calls the shared helperdocs/safe-outputs.md— documents the always-on behaviour and all override optionsBoth tools work with zero configuration. Override any field in front matter to customise the work item:
Stage 3 runs a WIQL query to find any non-closed item with the configured title. If found, a comment is appended; otherwise a new work item is created. If ADO credentials are not available the executor succeeds with a warning instead of failing hard.
Test plan
cargo test— all existing and new unit tests pass. New tests cover config deserialization, default field values, and the graceful-warning fallback when ADO credentials are not present.