Skip to content

Clear basedpyright unused/unreachable/type diagnostics in core server files - #30

Merged
Aztec03hub merged 1 commit into
mainfrom
fix-basedpyright-core-cleanup
Jun 23, 2026
Merged

Clear basedpyright unused/unreachable/type diagnostics in core server files#30
Aztec03hub merged 1 commit into
mainfrom
fix-basedpyright-core-cleanup

Conversation

@Aztec03hub

Copy link
Copy Markdown
Owner

Drives the authoritative basedpyright checker's targeted diagnostic classes to ZERO across the three core server files (cli.py, mcp_server.py, mcp_tools.py) with no runtime behavior change.

Diagnostic classes fixed (91 -> 0)

  • reportArgumentType (4): mcp_server.get_all_conversations annotated entry: dict[str, Any] (3); mcp_tools.auto_expire_profile_statuses_loop now casts the provider result to PublishFn | None (1).
  • reportUnusedCallResult (41): discarded expression results assigned to _ (e.g. _ = await client.subscribe(...), _ = registry.join(...)).
  • reportUnusedFunction (32): dead _expand_loopback_aliases (cli) and dead _get_presence (mcp_server) removed; the 30 @mcp.tool()-decorated comms_* registrations get a per-def # pyright: ignore[reportUnusedFunction] (the decorator use is not counted by basedpyright; the functions are live MCP tools and must NOT be deleted).
  • reportUnusedParameter (7): protocol-symmetry / stub params made genuinely accessed via del <param> as the first body statement (_noop_publish topic/payload/retain; tool_comms_kick conv_data_dir; tool_comms_dm_open / tool_comms_conversation_archive / tool_comms_conversation_unarchive publish_fn). Underscore-prefixing is insufficient.
  • reportUnnecessaryIsInstance (5): runtime-defensive isinstance(..., str/bytes) guards on already-typed inputs kept intact (behavior-preserving) and silenced with targeted inline ignores.
  • reportUnnecessaryComparison (2): redundant and _publish_fn is not None checks dropped in two comms_conversation_* handlers where a preceding assert _publish_fn is not None already narrows the type.

Out of scope (intentionally left)

The broad codebase-wide type-inference baseline noise is NOT touched: reportUnknown*, reportAny, reportExplicitAny, reportMissingParameterType, reportMissingTypeArgument, reportConstantRedefinition, etc. These are pre-existing baseline diagnostics unrelated to this cleanup.

Verification

  • basedpyright on the 3 files: targeted classes 91 -> 0; remaining 33 errors / 939 warnings are all the out-of-scope baseline.
  • ruff format + ruff check: clean.
  • Full pytest: 1456 passed.

🤖 Generated with Claude Code

@Aztec03hub
Aztec03hub merged commit 9ea97d7 into main Jun 23, 2026
2 of 8 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.

1 participant