Commit Graph

638 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 21a7eec6e7 docs: improve comments for standalone toolset metadata
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
- Enhanced field comment to clarify use case
- Added note about additive behavior to SetToolsetMetadata docstring

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-16 17:44:43 +01:00
copilot-swe-agent[bot] db6cb9da1f feat: support standalone toolset metadata in inventory builder
- Added `toolsetMetadata` field to Builder for registering standalone toolset metadata
- Added `SetToolsetMetadata()` method to Builder for setting standalone metadata
- Updated `processToolsets()` to include standalone metadata in default toolsets
- Updated `NewInventory()` to register remote-only toolset metadata
- Updated test expectations to include `copilot` in defaults

This change enables toolset metadata with `Default: true` to control whether
tools in that toolset are included by default, even if no tools in the OSS
repo use that toolset. The remote server can now register tools in the
`copilot` toolset and they will automatically be included in defaults.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-16 17:44:43 +01:00
Sam Morrow a372e2811e feat: mark copilot toolset as default
The copilot toolset contains important tools like
`create_pull_request_with_copilot` and `get_copilot_job_status` that
should be available by default in the remote MCP server.

By setting `Default: true` on the toolset metadata in OSS, the remote
server automatically picks it up without needing any special handling.
Even though no tools in OSS use this toolset, having the metadata here
allows consistent behavior when the remote server loads defaults.

This is a cleaner approach than having the remote server maintain its
own list of additional default toolsets.
2026-01-16 12:02:39 +01:00
Sam Morrow a663a6b1f8 feat: add progress notifications during PR polling in assign_copilot_to_issue
Add MCP progress notifications during the PR polling loop to provide
real-time status updates while waiting for Copilot to create a PR.

Changes:
- Use the request parameter to access the ServerSession for notifications
- Send an initial progress notification when polling starts
- Send progress updates on each polling attempt with attempt count
- Only send notifications when progressToken is provided by the client

This aligns with the behavior in create_pull_request_with_copilot tool
and improves the user experience during the waiting period.
2026-01-16 11:37:26 +01:00
Sam Morrow f1d33d51f6 refactor: use GraphQLFeaturesTransport internally
Replace inline GraphQL-Features header logic in bearerAuthTransport with
the exported GraphQLFeaturesTransport. This removes code duplication and
ensures the transport is actually used, not just exported.
2026-01-16 11:37:26 +01:00
Sam Morrow d3ff0a2d07 fix: address review feedback
- Document GraphQLFeaturesTransport is for library consumers
- Convert githubv4.Int/String to native Go types in result map
- Remove misleading log comment since tool handlers lack logger access
2026-01-16 11:37:26 +01:00
Sam Morrow 92d8d51f08 fix: remove tool name reference from pending note message 2026-01-16 11:37:26 +01:00
Sam Morrow bece2b54cc fix: filter PRs by timestamp to avoid returning stale results
When polling for a linked PR after assigning Copilot to an issue,
we now capture the assignment time before the mutation and filter
to only return PRs created after that time. This prevents the tool
from incorrectly returning old PRs from previous Copilot assignments.
2026-01-16 11:37:26 +01:00
Sam Morrow 09adfc71ba feat: poll for linked PR after assigning Copilot to issue
Enhances the assign_copilot_to_issue tool to automatically poll for
the PR created by the Copilot coding agent after assignment.

Changes:
- Add findLinkedCopilotPR() to query issue timeline for CrossReferencedEvent
  items from PRs authored by copilot-swe-agent
- Add polling loop (9 attempts, 1s delay) matching remote server latency
- Return structured JSON with PR details when found, or helpful note otherwise
- Add PollConfig for configurable polling (used in tests to disable)
- Add GraphQLFeaturesTransport for feature flag header support

The returned response now includes:
- issue_number, issue_url, owner, repo
- pull_request object (if found during polling)
- Note with instructions to use get_copilot_job_status if PR not yet created
2026-01-16 11:37:26 +01:00
Tony Truong 3af1129c6b adding feature flag on dependency level (#1801)
* wip injecting ff function into tool as dep

* remove debug

* fix linter

* add better test

* adding compile time check

* move experimental to seperate config/ff value

* adding test var

* fixing test

* adding flag and possibility to call feature checker

* fixing name
2026-01-16 11:22:39 +01:00
copilot-swe-agent[bot] ccf519177e Fix dismiss_notification to accept HTTP 204 No Content response
- Add http.StatusNoContent (204) to the list of accepted success status codes
- Add test case for 204 response when marking notification as done
- Retain existing test for 200 response for backwards compatibility

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-16 11:16:11 +01:00
copilot-swe-agent[bot] d88eb83a4f Add custom_instructions parameter to assign_copilot_to_issue tool
- Added optional custom_instructions parameter to tool schema
- Updated implementation to pass custom instructions to agent assignment
- Added test case to verify custom_instructions works correctly
- Updated toolsnaps and documentation

The custom_instructions parameter allows users to provide additional
context, constraints, or guidance to the Copilot agent beyond what's
in the issue body, addressing the issue where additional context
would otherwise be lost.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-15 18:09:34 +01:00
Tommaso Moro 19beb33c3f Bug fix: invalid tool should error out (#1776)
* get it working

* clean up approach by moving cleantools inside builder, this simplifies remote server too

* add tests for trimming and deduplication

* error out in the builder if there are unrecognized tools

---------

Co-authored-by: Sam Morrow <info@sam-morrow.com>
2026-01-15 17:37:06 +01:00
copilot-swe-agent[bot] 3ea9bfc790 Add test for struct field ordering in toolsnaps
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-15 17:33:22 +01:00
copilot-swe-agent[bot] 0bf791a4ce Regenerate toolsnaps with deterministic sorting
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-15 17:33:22 +01:00
copilot-swe-agent[bot] 87a1110c15 Implement recursive JSON key sorting for toolsnaps
Sort all JSON object keys alphabetically at every level in toolsnaps by
unmarshaling and remarshaling. This leverages Go's built-in behavior where
json.Marshal automatically sorts map keys alphabetically, ensuring
consistent field ordering and eliminating noop churn in diffs.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-15 16:15:39 +01:00
Oleksandr Redko 31b541ea08 chore: remove binary files 2026-01-12 19:59:21 +01:00
Sam Morrow f62ff634c5 Regenerate documentation TOCs
Docker / build (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
GoReleaser Release / release (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Publish to MCP Registry / publish (push) Has been cancelled
v0.28.1
2026-01-12 15:45:58 +01:00
copilot-swe-agent[bot] d18f26e559 Add GraphQL-Features header support for agent assignment API
- Add context-based GraphQL feature flag support
- Modify bearerAuthTransport to read features from context and add GraphQL-Features header
- Use issues_copilot_assignment_api_support feature flag for updateIssue mutation
- Export GetGraphQLFeatures function for use in HTTP transport layer

This allows the assign_copilot_to_issue tool to work with the non-GA agent assignment API
by sending the required GraphQL-Features header.

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-12 15:45:58 +01:00
copilot-swe-agent[bot] 88d117bd82 Add base_ref support to assign_copilot_to_issue tool
- Add optional base_ref parameter to tool schema
- Change from replaceActorsForAssignable to updateIssue mutation with agentAssignment
- Add AgentAssignmentInput and UpdateIssueInput structs for new GraphQL mutation
- Update all tests to use new mutation structure
- Add test case for base_ref functionality
- Update toolsnaps and documentation

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-12 15:45:58 +01:00
Sam Morrow c44ce2e2b8 chore: remove unused filterResourcesByURI function
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Docker / build (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
GoReleaser Release / release (push) Has been cancelled
Publish to MCP Registry / publish (push) Has been cancelled
v0.28.0
2026-01-12 14:19:11 +01:00
Sam Morrow 53a672040f fix: keep all resources registered for resources/read requests
The ForMCPRequest optimization was incorrectly filtering resources by
doing an exact string match between the URI template pattern and the
concrete URI. This would never match because templates like
'repo://{owner}/{repo}/contents{/path*}' don't match concrete URIs
like 'repo://owner/repo/contents/file.py'.

Instead of implementing template matching in the inventory, we simply
keep all resources registered for resources/read requests and let the
SDK handle URI template matching internally (which it already does
correctly via uritemplate.Regexp().MatchString()).

This fixes resources/read returning 'Resource not found' for valid URIs.
2026-01-12 14:19:11 +01:00
Sam Morrow 676956faf3 Fix resource handler to use deps from context
The RepositoryResourceContentsHandler was using closure-captured deps
instead of retrieving them from context at call time. This causes issues
on the remote server which injects per-request deps via context.

Changed to use MustDepsFromContext(ctx) pattern consistent with tool
handlers in NewTool and NewToolFromHandler.
2026-01-12 14:05:19 +01:00
copilot-swe-agent[bot] 8058d30709 Update automation to use toolset IDs instead of display names
The generate-docs command now outputs toolset IDs (e.g., `actions`, `code_security`)
wrapped in backticks instead of display names (e.g., "Actions", "Code Security").

This ensures the manual changes from PR #1756 persist when the docs are regenerated,
fixing the issue where users need to configure the actual toolset ID, not the display name.

Changes:
- Modified generateRemoteToolsetsDoc() to use `idStr` instead of `formattedName()`
- Modified generateRemoteOnlyToolsetsDoc() to use `idStr` instead of `formattedName()`
- Both functions now wrap the toolset ID in backticks for clarity

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-12 10:45:37 +01:00
Ksenia Bobrova 44d9e1329e Bringing back local mcp server registry config (#1767)
* Bringing back local mcp server registry config

* Making auth header optional
2026-01-09 13:41:11 +01:00
Tommaso Moro b1ab893af3 bug fix (#1775) 2026-01-09 12:10:42 +00:00
copilot-swe-agent[bot] c061804405 Use default scope in examples and clarify --scope flag is optional
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 21:34:03 +00:00
copilot-swe-agent[bot] e33550311a Update Claude Code installation command to use add-json format for v2.1.1+
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 21:34:03 +00:00
copilot-swe-agent[bot] ff0e67e008 Add formatScopeDisplay helper and improve empty scope handling
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] 33014a66ef Add helpers.go with shared formatToolsetName function
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] cd75b9b96b Refactor formatToolsetName to shared helper function
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] d2df189e98 Add list_scopes.go implementation file
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
copilot-swe-agent[bot] ee8f4e6bc5 Add list-scopes command using inventory architecture
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-08 10:52:36 +00:00
Tommaso Moro f2ff9d22fe updated (#1756) 2026-01-08 09:53:48 +00:00
Sam Morrow cc9e8645c1 Fix nil pointer dereference in completion handler
The CompleteParams.Context field is optional (marked omitempty) and can be
nil when clients don't send it. The code was accessing Context.Arguments
directly without checking if Context was nil first, causing a panic.

This fix adds a nil check for Context before accessing Arguments.
2026-01-07 15:44:58 +00:00
Florian Grousset ab23070b43 Update command instructions for terminal usage
Clarified instructions to run commands in the terminal instead of Claude Code CLI.
2026-01-07 09:36:21 +00:00
Matt Holloway 71862a93e4 update tests to use new mock pattern 2026-01-06 17:38:12 +00:00
Matt Holloway a57b4726e5 add http resp code checking for getProjectItem 2026-01-06 17:38:12 +00:00
Matt Holloway be5a449e48 fix project tools to add scope to newtool init 2026-01-06 17:38:12 +00:00
Matt Holloway 099f995615 revert "hold-bac feature flag" 2026-01-06 17:38:12 +00:00
Matt Holloway 7b30c930f8 update docs 2026-01-06 17:38:12 +00:00
Matt Holloway 304f07401e hold-bac feature flag 2026-01-06 17:38:12 +00:00
Matt Holloway 3cd0be2af2 update tool aliases 2026-01-06 17:38:12 +00:00
Matt Holloway 66a01645f8 initial projects consolidation 2026-01-06 17:38:12 +00:00
Copilot 80b0306557 Replace go-github-mock with stretchr/testify for actions/issues/projects tests (#1737)
* Initial plan

* migrate tests from go-github-mock to internal testify-based mock

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* address feedback in testmock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* tweak testmock path matching edge case

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* refine testmock options and path matching

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* simplify matchPath and document delete endpoint

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Replace go-github-mock usage in tests with shared HTTP mock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Replace go-github-mock usage in tests with shared HTTP mock helper

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* fix tests and lint after mock cleanup

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Remove import completely

* Partial removal in repositories_test.go

* Final removal

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
Co-authored-by: JoannaaKL <joannaakl@github.com>
2026-01-06 10:45:29 +01:00
Sam Morrow 7d4a4a68c3 Document public repo access quirk for read-only tools 2026-01-05 16:05:24 +00:00
Sam Morrow c428f72863 Don't filter read-only repo tools (work on public repos without scope) 2026-01-05 16:05:24 +00:00
Sam Morrow c80976661e Mention OAuth scope challenges in server-configuration.md 2026-01-05 16:05:24 +00:00
Sam Morrow 9aef43596e Fix server-configuration.md scope filtering description 2026-01-05 16:05:24 +00:00
Sam Morrow 4deaa8321e Remove empty filter.go and document OAuth scope challenges 2026-01-05 16:05:24 +00:00