Tool handlers receive a context.Context from the MCP frame but most operation modules ignore it — they construct a fresh Gitea SDK client (with its own 60s timeout in pkg/gitea/rest.go) and call methods that don't take a context. As a result:
An HTTP client that disconnects mid-call cannot cancel the upstream Gitea request
Graceful shutdown (10s timeout in operation/operation.go) only stops accepting new connections; in-flight tool calls continue
Per-request deadlines aren't honored
Suggested direction
Where the SDK exposes *Ctx variants, switch to them and pass the handler's ctx
Where the SDK does not, wrap the client's http.ClientTransport with one that watches ctx.Done() and aborts the request
Set a sensible per-call deadline (e.g. 30s) derived from the parent context
Verify graceful shutdown actually cancels in-flight work
## Problem
Tool handlers receive a `context.Context` from the MCP frame but most operation modules ignore it — they construct a fresh Gitea SDK client (with its own 60s timeout in `pkg/gitea/rest.go`) and call methods that don't take a context. As a result:
- An HTTP client that disconnects mid-call cannot cancel the upstream Gitea request
- Graceful shutdown (10s timeout in `operation/operation.go`) only stops accepting new connections; in-flight tool calls continue
- Per-request deadlines aren't honored
## Suggested direction
- Where the SDK exposes `*Ctx` variants, switch to them and pass the handler's `ctx`
- Where the SDK does not, wrap the client's `http.Client` `Transport` with one that watches `ctx.Done()` and aborts the request
- Set a sensible per-call deadline (e.g. 30s) derived from the parent context
- Verify graceful shutdown actually cancels in-flight work
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Tool handlers receive a
context.Contextfrom the MCP frame but most operation modules ignore it — they construct a fresh Gitea SDK client (with its own 60s timeout inpkg/gitea/rest.go) and call methods that don't take a context. As a result:operation/operation.go) only stops accepting new connections; in-flight tool calls continueSuggested direction
*Ctxvariants, switch to them and pass the handler'sctxhttp.ClientTransportwith one that watchesctx.Done()and aborts the request