8000 fix(clippy): allow result_large_err on client_or_connect (unblocks CI on main) by luisaniceto-infra · Pull Request #111 · avelino/mcp · GitHub
[go: up one dir, main page]

Skip to content

fix(clippy): allow result_large_err on client_or_connect (unblocks CI on main) - #111

Merged
avelino merged 1 commit into
avelino:mainfrom
luisaniceto-infra:fix/clippy-result-large-err-on-main
Sep 17, 2026
Merged

avelino merged 1 commit into
avelino:mainfrom
luisaniceto-infra:fix/clippy-result-large-err-on-main

Conversation

@luisaniceto-infra
Copy link
Copy Markdown
Contributor

O que está acontecendo

cargo clippy -- -D warnings falha na main. O CI está vermelho desde 26/08 (run 33011293588) e toda PR herda esse check vermelho — foi assim que descobri, investigando por que o CI da #110 falhou.

O log da main mostra exatamente um erro:

error: the `Err`-variant returned from this function is very large
  --> src/serve/dispatch.rs:762:6
     the `Err`-variant is at least 152 bytes

A correção

clippy::result_large_err em client_or_connect: Result<Arc<McpClient>, JsonRpcResponse> passa do limite default de 128 bytes.

JsonRpcResponse é o tipo de erro deste módulo por desenho — uma falha aqui é a resposta que o caller repassa. Então vale o mesmo #[allow] que ProxyServer::resolve_tool_call já carrega, pelo mesmo motivo. Uma linha, mais o comentário dizendo por quê.

Boxar JsonRpcResponse é a outra resposta, e provavelmente a melhor. Mas muda o tipo de erro em todos os caminhos de dispatch de uma vez — isso merece mudança própria, não um desbloqueio de CI. Se você preferir por esse caminho, eu faço.

Verificação

Em container rust:1-slim, nesta branch saindo da main:

cargo fmt --all --check limpo
cargo clippy -- -D warnings limpo
cargo test 812 passed; 0 failed

Por que separado da #110

A #110 é feature. Isto é bug de CI que já existia antes dela e afeta todo mundo. Misturar os dois esconderia o desbloqueio dentro de um diff de 400 linhas, e você não conseguiria reverter um sem o outro.

Com esta mergeada, o CI da #110 fica verde — o outro erro que aparecia lá era meu (um #[allow] deslocado) e já está corrigido no commit 41cd99c.

🤖 Generated with Claude Code

`cargo clippy -- -D warnings` fails on main, so CI has been red since
2026-08-26 (run 33011293588) and every PR inherits a red check.

The lint is `clippy::result_large_err` on `client_or_connect`:
`Result<Arc<McpClient>, JsonRpcResponse>` has an Err variant of at least 152
bytes, past the 128-byte default threshold.

`JsonRpcResponse` is the error type across this module by design — a failure
here IS the reply the caller relays — so the same `#[allow]` that
`ProxyServer::resolve_tool_call` already carries applies, for the same reason.

Boxing `JsonRpcResponse` is the other answer and arguably the better one, but
it changes the error type on every dispatch path at once; that belongs in its
own change, not in a CI unblock.

Verified in a rust:1-slim container, on this branch off main:
  cargo fmt --all --check       clean
  cargo clippy -- -D warnings   clean
  cargo test                    812 passed; 0 failed

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
avelino added a commit that referenced this pull request Sep 17, 2026
main has been red on this lint since dcd75dc and the branch inherits it, so
CI here failed at the clippy step and skipped cargo test entirely. The 839
tests on this branch had never actually run in CI.

Same allow the module already carries on resolve_tool_call, for the same
reason: JsonRpcResponse is the error type across dispatch by design, because
a failure here is the reply the caller relays. Boxing it is the other answer
and it changes the error type on every dispatch path at once, which does not
belong in this branch. The hunk is byte for byte identical to the one in
PR #111, so whichever of the two lands first the other still merges clean.

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
avelino added a commit that referenced this pull request Sep 17, 2026
main has been red on this lint since dcd75dc and the branch inherits it, so
CI here failed at the clippy step and skipped cargo test entirely. The 839
tests on this branch had never actually run in CI.

Same allow the module already carries on resolve_tool_call, for the same
reason: JsonRpcResponse is the error type across dispatch by design, because
a failure here is the reply the caller relays. Boxing it is the other answer
and it changes the error type on every dispatch path at once, which does not
belong in this branch. The hunk is byte for byte identical to the one in
PR #111, so whichever of the two lands first the other still merges clean.

Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
@avelino
avelino merged commit 83cf95b into avelino:main Sep 17, 2026
3 checks passed
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.

2 participants

0