Commit Graph

626 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 345584c9ca Rename NewServerToolWithRawContextHandler to NewServerTool
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
- Renamed deprecated NewServerTool[In, Out] to NewServerToolWithDeps[In, Out]
- Updated dynamic_tools.go to use NewServerToolWithDeps (for special case with DynamicToolDependencies)
- Renamed NewServerToolWithRawContextHandler to NewServerTool
- Updated all call sites in dependencies.go and registry_test.go
- All tests pass, linter passes

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-12 22:14:50 +00:00
copilot-swe-agent[bot] 02314efbe0 Initial plan 2026-01-12 22:03:08 +00:00
copilot-swe-agent[bot] 6308b1edf1 Remove deprecated NewServerToolFromHandler function
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
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
- Removed NewServerToolFromHandler function from pkg/inventory/server_tool.go
- Updated test helper functions (mockTool and mockToolWithDefault) to use NewServerToolWithRawContextHandler
- All tests pass successfully

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
2026-01-12 20:25:38 +00:00
copilot-swe-agent[bot] 1c06ad5453 Initial plan 2026-01-12 20:18:41 +00: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
Sam Morrow f14f507a39 Add tip about editing PAT scopes in GitHub UI 2026-01-05 16:05:24 +00:00
Sam Morrow acd7929281 Document that GitHub App and server-to-server tokens are not filtered 2026-01-05 16:05:24 +00:00
Sam Morrow c2450ce96a Update pkg/scopes/filter.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-05 16:05:24 +00:00
Sam Morrow 39fed357f4 Remove manual scope-to-tools table from docs
The README already has auto-generated tool documentation with scopes.
Keep only the scope hierarchy explanation which is structural.
2026-01-05 16:05:24 +00:00
Sam Morrow 8afb4fb16e Only check scopes for classic PATs (ghp_ prefix)
- Scope filtering only applies to classic PATs which return X-OAuth-Scopes
- Fine-grained PATs and other token types skip filtering (all tools shown)
- Updated docs to clarify PAT filtering vs OAuth scope challenges
2026-01-05 16:05:24 +00:00
Sam Morrow f45b94a8f5 Make scope filtering always enabled (remove flag)
Scope filtering is now a built-in feature rather than a configurable option.
The server automatically fetches token scopes at startup and filters tools
accordingly. If scope detection fails, it logs a warning and continues with
all tools available.
2026-01-05 16:05:24 +00:00
Sam Morrow a19a159d0a Enable scope filtering by default 2026-01-05 16:05:24 +00:00
Sam Morrow 46b8cb63ac Add PAT scope filtering for stdio server
Add the ability to filter tools based on token scopes for PAT users.
This uses an HTTP HEAD request to GitHub's API to discover token scopes.

New components:
- pkg/scopes/filter.go: HasRequiredScopes checks if scopes satisfy tool requirements
- pkg/scopes/fetcher.go: FetchTokenScopes gets scopes via HTTP HEAD to GitHub API
- pkg/github/scope_filter.go: CreateScopeFilter creates inventory.ToolFilter

Integration:
- Add --filter-by-scope flag to stdio command (disabled by default)
- When enabled, fetches token scopes on startup
- Tools requiring unavailable scopes are hidden from tool list
- Gracefully continues without filtering if scope fetch fails (logs warning)

This allows the OSS server to have similar scope-based tool visibility
as the remote server, and the filter logic can be reused by remote server.
2026-01-05 16:05:24 +00:00
Sam Morrow 48744ca556 Sort scope slices for deterministic output
Map iteration in Go is non-deterministic, which causes doc generation
to produce different output on each run. Sort the scope slices in:
- ScopeSet.ToSlice()
- ScopeSet.ToStringSlice()
- ExpandScopes()
2026-01-05 15:54:17 +00:00
Sam Morrow cec5a1ae0f Fix conflict and regenerate docs after rebase 2026-01-05 15:54:17 +00:00
Sam Morrow df9fc6a3b3 Use repo scope for star/unstar tools instead of public_repo
public_repo is implicit - the GitHub API handles the distinction between
public and private repos. Using repo as the required scope is more
consistent with our enforcement model:
- PATs: tools visible if token has repo scope
- OAuth: scope challenge requests repo scope
2026-01-05 15:54:17 +00:00
Sam Morrow 3d1ae306f8 refres readme after update 2026-01-05 15:54:17 +00:00