Skip to content

Keep automation confirmation on delete only and tighten tool schemas - #3867

Open
A-Georgiou wants to merge 2 commits into
mainfrom
a-georgiou/automation-tool-fixes
Open

A-Georgiou wants to merge 2 commits into
mainfrom
a-georgiou/automation-tool-fixes

Conversation

@A-Georgiou

@A-Georgiou A-Georgiou commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #3719. Only delete_automation keeps the request-state confirmation. The automation tools also reject unknown arguments, list_automation_revisions returns next_cursor, and create and update are marked non-destructive.

Why

Part of github/sweagentd#16692, which moves the hosted automation tools onto these tools.

  • create_automation, update_automation and run_automation required protocol 2026-07-28 with form elicitation. Clients without multi-round-trip support could not list them, and HTTP mode hid them when no request-state key was set. The hosted tools have no confirmation step, and delete_repository is the only other tool behind this gate.
  • The input schemas allowed extra properties. Hosted-only arguments such as ownership were silently dropped, so the automation was created with the default personal type.
  • The revisions endpoint returns its cursor only in the Link header, so callers could not get past the first page.
  • The hosted tools mark create and update as non-destructive.

What changed

  • Removed the confirmation from create, update and run, along with "after explicit user confirmation" in their descriptions. delete_automation is unchanged.
  • In HTTP mode without MRTRStateKey, only delete_automation and delete_repository are hidden. Renamed the internal field to disableDeleteAutomation.
  • All automation input schemas set additionalProperties: false, and a shared input normalizer rejects unknown arguments on every path, including direct ServerTool.Handler calls.
  • When go-github parses a rel="next" cursor, the response gains a next_cursor field, matching the hosted output.
  • Set destructiveHint: false on create and update.
  • Updated the toolsnaps and tests, and added tests for unknown arguments and the revisions cursor.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
    Create, update and run no longer require a multi-round-trip client. All 11 automation tools reject unknown arguments, and revisions output can include next_cursor.
  • New tool added

Prompts tested (tool changes only)

No natural-language prompts. I called the tools directly through the stdio server against the live API with a 2025-06-18 client, without making any changes:

  • tools/list returned 10 automation tools, including create, update and run. delete_automation stayed hidden.
  • list_automation_revisions with perPage: 1 returned revisions 3, 2 and 1 across three pages by following next_cursor.
  • create_automation with ownership failed with invalid arguments: unexpected argument "ownership" and sent no request.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
    Create, update and run still need the repo scope, and the API requires repository write access for each of them. Deletion keeps its typed confirmation. This matches the hosted tools and the other write tools in this server.
  • Data exposure, filtering, or token/size limits considered
    Unknown arguments are rejected before any request is sent. Name sanitization still applies to responses that include next_cursor.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

script/generate-docs produces no changes. docs/streamable-http.md still says every automation mutation tool needs request state, so that sentence will be updated in a separate docs PR.

Skills

  • Updated relevant skills or confirmed no bundled skill applies
    No bundled skill covers the automation tools.

Only delete_automation keeps the multi-round-trip confirmation, so create,
update and run stay available to clients without form elicitation. Reject
unknown automation arguments, return the revisions next_cursor from the
Link header, and mark create and update as non-destructive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
@A-Georgiou
A-Georgiou requested a review from a team as a code owner November 16, 2026 13:11
Copilot AI adaptive review requested due to automatic review settings November 16, 2026 13:11
Comment thread pkg/github/agent_automations.go Dismissed
Comment thread pkg/http/handler.go Dismissed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Direct handler calls bypass the SDK-only argument validation, allowing an unknown ownership field to produce a creation request without type and silently default to personal ownership.

1 open issue
What changed in this PR

Aligns the public Copilot automation tools with hosted behavior and improves compatibility with clients that do not support confirmation round trips.

Changes:

  • Removes confirmation requirements for create, update, and run; preserves deletion confirmation and HTTP safeguards.
  • Tightens all automation input schemas and marks create and update as non-destructive.
  • Adds revision pagination cursors and updates tests and tool snapshots.
File Description
pkg/​http/​server.go Narrows the request-state flag to automation deletion.
pkg/​http/​server_test.go Updates request-state configuration assertions.
pkg/​http/​handler.go Limits missing-key filtering to deletion tools.
pkg/​http/​handler_test.go Verifies create, update, and run remain available.
pkg/​github/​agent_automations.go Updates confirmation, schemas, annotations, and cursor output.
pkg/​github/​agent_automations_test.go Tests validation, pagination, and deletion-only confirmation.
pkg/​github/​__toolsnaps__/​update_automation.snap Records updated confirmation, validation, and annotations.
pkg/​github/​__toolsnaps__/​run_automation.snap Records removed confirmation and stricter input schema.
pkg/​github/​__toolsnaps__/​list_available_automation_triggers.snap Records rejection of extra arguments.
pkg/​github/​__toolsnaps__/​list_available_automation_tools.snap Records rejection of extra arguments.
pkg/​github/​__toolsnaps__/​list_automations.snap Records rejection of extra arguments.
pkg/​github/​__toolsnaps__/​list_automation_revisions.snap Records rejection of extra arguments.
pkg/​github/​__toolsnaps__/​get_automations_configuration_for_repository.snap Records rejection of extra arguments.
pkg/​github/​__toolsnaps__/​get_automation.snap Records rejection of extra arguments.
pkg/​github/​__toolsnaps__/​get_automation_revision.snap Records rejection of extra arguments.
pkg/​github/​__toolsnaps__/​delete_automation.snap Tightens inputs while retaining confirmation.
pkg/​github/​__toolsnaps__/​create_automation.snap Records updated confirmation, validation, and annotations.

Review effort: Max (dynamic)

Comment thread pkg/github/agent_automations.go Resolved
The schema only rejected extra arguments when the SDK validated the call.
A shared input normalizer now rejects them on every path, including direct
ServerTool.Handler calls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
Comment thread pkg/github/agent_automations.go Dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants