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>
- 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>
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.
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.
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.
- 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
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.
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
* 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
- 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>
- 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>
* 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>
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>
- 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>
- 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>
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.
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.
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>
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.