Skip to content

fix(mcp): black formatting violation in mcp_bridge.py blocks CI #833

Closed

Description

@itomek

Summary

src/gaia/mcp/mcp_bridge.py:631 has a long dict literal on a single line that black wants to split across 4 lines. The file is in the repo's black-check scope (util/lint.py step 1/9), so every PR currently fails the Run Code Quality Checks CI job until this is fixed on main.

Surfaced while preparing release PR #831 (v0.17.3) — that PR doesn't touch mcp_bridge.py but inherits the failing check from main.

Reproduction

uv pip install black --quiet
uv run python -m black --check src/gaia/mcp/mcp_bridge.py
# → would reformat src/gaia/mcp/mcp_bridge.py
# → exit 1

Full diff:

--- src/gaia/mcp/mcp_bridge.py  (before)
+++ src/gaia/mcp/mcp_bridge.py  (after black)
@@ -626,11 +626,14 @@
         if not isinstance(data, dict):
             self.send_json(
                 400,
                 {
                     "jsonrpc": "2.0",
-                    "error": {"code": -32600, "message": "Invalid Request: expected JSON object"},
+                    "error": {
+                        "code": -32600,
+                        "message": "Invalid Request: expected JSON object",
+                    },
                     "id": None,
                 },
             )
             return

Origin

Introduced by #803 (fix(mcp): guard JSON-RPC handler against non-dict body). CI presumably passed at merge time with an older black version; the current pinned version flags it.

Fix

One command:

uv run python -m black src/gaia/mcp/mcp_bridge.py

Commit as style(mcp): apply black formatting to mcp_bridge.py. No behavior change.

Impact

  • Blocks all PRs on the Run Code Quality Checks status, including release PR Release v0.17.3 #831.
  • Low-risk fix; no production code behavior change.

Activity

  1. github-actions commented on Apr 20, 2026

    @github-actions
    Contributor

    Thanks @itomek — reproduced and confirmed. 🟡

    Verification:

    • python -m black --check --diff src/gaia/mcp/mcp_bridge.py produces exactly the diff in the report (line 631 → 4-line split).
    • util/lint.py:113 runs black --check over LINT_DIRS = [src/, tests/] (util/lint.py:47), so src/gaia/mcp/mcp_bridge.py:631 is in scope and python util/lint.py --black fails on main.
    • Origin tracks to fix(mcp): guard JSON-RPC handler against non-dict body #803 as suspected — the 1-line error dict was added there (src/gaia/mcp/mcp_bridge.py:631), and the surrounding send_json(...) call already spans multiple lines, so black splitting the inner dict for consistency makes sense.

    Fix is a one-liner and the proposed commit message (style(mcp): apply black formatting to mcp_bridge.py) matches the repo's conventional-commits style. The same spot at src/gaia/mcp/mcp_bridge.py:642 uses a shorter message and stays on one line, so only the one call site needs to change.

    Suggested approach (per CLAUDE.md → "Commit Only When Bulletproof"):

    python -m black src/gaia/mcp/mcp_bridge.py
    python util/lint.py --black     # should now pass
    python -m pytest tests/mcp/ -xvs   # sanity-check nothing else in mcp/ regressed

    Happy to open a PR with this fix if a maintainer gives the go-ahead — it's a pure-formatting change with no behavior delta, so it shouldn't conflict with release PR #831 and could land ahead of it to unblock CI.

  2. added
    track:platformFoundation that both consumer-app and oem-pc tracks consume
    domain:platformFoundation: Lemonade, providers, runtime, install, packaging
    on Apr 26, 2026
  3. kovtcharov commented on Apr 26, 2026

    @kovtcharov
    Contributor

    Verified fixed on origin/main: the dict literal at src/gaia/mcp/mcp_bridge.py:631 is now properly multi-line (introduced by PR #803 'guard JSON-RPC handler against non-dict body'). The black violation no longer exists.

  4. self-assigned this
    on Apr 28, 2026
  5. added a commit that references this issue on May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:platformFoundation: Lemonade, providers, runtime, install, packagingtrack:platformFoundation that both consumer-app and oem-pc tracks consume

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions