Skip to content

feat(mcp): add MCP server management - #25

Closed
alanwang233233 wants to merge 4 commits into
mainfrom
feat/mcp
Closed

alanwang233233 wants to merge 4 commits into
mainfrom
feat/mcp

Conversation

@alanwang233233

Copy link
Copy Markdown
Owner

feat(mcp): add MCP server management

Copilot AI and others added 3 commits August 27, 2026 15:09
@qodo-code-review

qodo-code-review Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

No reviewable changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T02:44:07.808787Z 5cbed57 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alanwang233233 alanwang233233 changed the title Feat/mcp feat(mcp): add MCP server management Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CI 检查结果汇总

  • pytest: ✅ 通过 — 144 个测试,
    errors=0, failures=0, skipped=0
  • 覆盖率: ✅ 通过 — 81.26%(720/886 行)
  • gitleaks: ✅ 通过 — 发现 0 条潜在泄露
  • black: ✅ 已应用格式化 — 已自动格式化代码
  • pylint: ✅ 通过 — 评分 9.63/10,共 52 条问题

信息展示

  • pyright: 31 个 error, 0 个 warning
📋 pytest 详细
============================= test session starts ==============================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.6.0
rootdir: /home/runner/work/MitoCode/MitoCode
configfile: pyproject.toml
plugins: asyncio-1.4.0, platformdirs-4.13.0, cov-7.1.0, anyio-4.15.1
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 144 items

test/test_agent_runtime.py ............................                  [ 19%]
test/test_agent_session.py ............................................. [ 50%]
............                                                             [ 59%]
test/test_main.py .                                                      [ 59%]
test/test_orchestrator_and_bridge.py ............                        [ 68%]
test/test_tool_manager.py ......                                         [ 72%]
test/test_workspace.py ......................................            [ 98%]
test/test_workspace_async.py ..                                          [100%]

------ generated xml file: /home/runner/work/MitoCode/MitoCode/report.xml ------
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.14.8-final-0 ________________

Name                                                         Stmts   Miss  Cover
--------------------------------------------------------------------------------
src/mitocode/__init__.py                                         4      0   100%
src/mitocode/backend/__init__.py                                 3      0   100%
src/mitocode/backend/agent/__init__.py                           8      0   100%
src/mitocode/backend/agent/agent_node.py                        10      0   100%
src/mitocode/backend/agent/agent_orchestrator.py               115     35    70%
src/mitocode/backend/agent/agent_runtime.py                     91      0   100%
src/mitocode/backend/agent/agent_session.py                    133      1    99%
src/mitocode/backend/agent/agent_state.py                        8      0   100%
src/mitocode/backend/agent/session_factory.py                    6      0   100%
src/mitocode/backend/bridge/__init__.py                          2      0   100%
src/mitocode/backend/bridge/event_adapter.py                    25      0   100%
src/mitocode/backend/chat_provider/__init__.py                   4      0   100%
src/mitocode/backend/chat_provider/chat_provider_openai.py      50     34    32%
src/mitocode/backend/chat_provider/sample_chat_provider.py      39     18    54%
src/mitocode/backend/exception/__init__.py                       2      0   100%
src/mitocode/backend/exception/mitocode_exception.py            19      0   100%
src/mitocode/backend/tool/__init__.py                            2      0   100%
src/mitocode/backend/tool/tool_manager.py                      105     28    73%
src/mitocode/backend/workspace/__init__.py                       3      0   100%
src/mitocode/backend/workspace/migration.py                     77     39    49%
src/mitocode/backend/workspace/snapshot.py                       0      0   100%
src/mitocode/backend/workspace/workspace.py                    180     11    94%
--------------------------------------------------------------------------------
TOTAL                                                          886    166    81%
Coverage XML written to file coverage.xml
Required test coverage of 80% reached. Total coverage: 81.26%
============================= 144 passed in 1.58s ==============================
🔒 gitleaks 详细
[]
📝 pyright 输出
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_runtime.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_runtime.py:91:32 - error: "Dict[Unknown, Unknown]" is not iterable
    "__aiter__" method not defined (reportGeneralTypeIssues)
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_session.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_session.py:133:41 - error: Type "Unknown | None" is not assignable to declared type "_SampleChatProvider"
    Type "Unknown | None" is not assignable to type "_SampleChatProvider"
      "None" is not assignable to "_SampleChatProvider" (reportAssignmentType)
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py:75:35 - error: Parameter declaration "path" is obscured by a declaration of the same name (reportRedeclaration)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py:92:54 - error: Operator "/" not supported for types "Path | str" and "Literal['.mitocode']"
    Operator "/" not supported for types "str" and "Literal['.mitocode']" (reportOperatorIssue)
/home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:286:13 - error: Argument of type "VisualType" cannot be assigned to parameter "renderable" of type "RenderableType" in function "__init__"
    Type "VisualType" is not assignable to type "RenderableType"
      Type "SupportsVisual" is not assignable to type "RenderableType"
        "SupportsVisual" is incompatible with protocol "ConsoleRenderable"
          "__rich_console__" is not present
        "SupportsVisual" is incompatible with protocol "RichCast"
          "__rich__" is not present
        "SupportsVisual" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:326:15 - error: Type "reactive[str]" is not assignable to declared type "property"
    "reactive[str]" is not assignable to "property" (reportAssignmentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:330:9 - error: Operator "+=" not supported for types "VisualType" and "str"
    Operator "+" not supported for types "ConsoleRenderable" and "str"
    Operator "+" not supported for types "RichCast" and "str"
    Operator "+" not supported for types "SupportsVisual" and "str"
    Operator "+" not supported for types "Visual" and "str" (reportOperatorIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:330:14 - error: "content" incorrectly overrides property of same name in class "Static" (reportIncompatibleMethodOverride)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:334:26 - error: Argument of type "VisualType" cannot be assigned to parameter "markup" of type "str" in function "__init__"
    Type "VisualType" is not assignable to type "str"
      "ConsoleRenderable" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:346:15 - error: Type "reactive[str]" is not assignable to declared type "property"
    "reactive[str]" is not assignable to "property" (reportAssignmentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:350:9 - error: Operator "+=" not supported for types "VisualType" and "str"
    Operator "+" not supported for types "ConsoleRenderable" and "str"
    Operator "+" not supported for types "RichCast" and "str"
    Operator "+" not supported for types "SupportsVisual" and "str"
    Operator "+" not supported for types "Visual" and "str" (reportOperatorIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:350:14 - error: "content" incorrectly overrides property of same name in class "Static" (reportIncompatibleMethodOverride)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:354:26 - error: Argument of type "VisualType" cannot be assigned to parameter "markup" of type "str" in function "__init__"
    Type "VisualType" is not assignable to type "str"
      "ConsoleRenderable" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:428:35 - error: Cannot access attribute "append" for class "Static"
    Attribute "append" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:441:35 - error: Cannot access attribute "append" for class "Static"
    Attribute "append" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:483:35 - error: Cannot access attribute "append_code" for class "Static"
    Attribute "append_code" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:495:23 - error: Cannot access attribute "finalize" for class "Static"
    Attribute "finalize" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:497:23 - error: Cannot access attribute "end" for class "Static"
    Attribute "end" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:756:17 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:756:31 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:757:32 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:758:18 - error: "select_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:759:18 - error: "scroll_to_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:822:25 - error: "select_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:823:25 - error: "scroll_to_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:902:31 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:908:33 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:931:29 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:991:24 - error: Object of type "None" is not subscriptable (reportOptionalSubscript)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:993:31 - error: "get" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:997:25 - error: "set_widgets" is not a known attribute of "None" (reportOptionalMemberAccess)
31 errors, 0 warnings, 0 informations

自动提交状态: 已自动提交 ✅


由 CI 自动生成

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Remove the hardcoded credential and implement or correctly scope the claimed MCP functionality.

2 open findings
What changed in this PR

The PR claims to add MCP server management, but the changes only reformat existing provider setup and remove whitespace.

Changes:

  • Reformatted OpenAI provider initialization.
  • Removed an extra blank line.
  • Retained a hardcoded credential-like API key.
File Summary
src/​mitocode/​backend/​chat_provider/​scenario_provider.py Removed an unnecessary blank line.
src/​mitocode/​__main__.py Reformatted provider setup; retains an exposed credential and lacks MCP implementation.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/mitocode/__main__.py
default_tools=None,
stream=True,
settings={
"api_key": "sk-别看了这次我不会再把key提交到仓库了!",
Comment thread src/mitocode/__main__.py
Comment on lines +72 to +74
provider = asyncio.run(
ChatProviderOpenAI.factory(
default_model="nvidia/nemotron-3.5-lightning:free",
@alanwang233233
alanwang233233 marked this pull request as draft October 16, 2026 12:32
@github-actions

Copy link
Copy Markdown
Contributor

CI 检查结果汇总

  • pytest: ✅ 通过 — 144 个测试,
    errors=0, failures=0, skipped=0
  • 覆盖率: ✅ 通过 — 81.26%(720/886 行)
  • gitleaks: ✅ 通过 — 发现 0 条潜在泄露
  • black: ✅ 已应用格式化 — 已自动格式化代码
  • pylint: ✅ 通过 — 评分 9.63/10,共 52 条问题

信息展示

  • pyright: 31 个 error, 0 个 warning
📋 pytest 详细
============================= test session starts ==============================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.7.0
rootdir: /home/runner/work/MitoCode/MitoCode
configfile: pyproject.toml
plugins: asyncio-1.4.0, platformdirs-4.13.3, cov-7.1.0, anyio-4.15.1
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 144 items

test/test_agent_runtime.py ............................                  [ 19%]
test/test_agent_session.py ............................................. [ 50%]
............                                                             [ 59%]
test/test_main.py .                                                      [ 59%]
test/test_orchestrator_and_bridge.py ............                        [ 68%]
test/test_tool_manager.py ......                                         [ 72%]
test/test_workspace.py ......................................            [ 98%]
test/test_workspace_async.py ..                                          [100%]

------ generated xml file: /home/runner/work/MitoCode/MitoCode/report.xml ------
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.14.8-final-0 ________________

Name                                                         Stmts   Miss  Cover
--------------------------------------------------------------------------------
src/mitocode/__init__.py                                         4      0   100%
src/mitocode/backend/__init__.py                                 3      0   100%
src/mitocode/backend/agent/__init__.py                           8      0   100%
src/mitocode/backend/agent/agent_node.py                        10      0   100%
src/mitocode/backend/agent/agent_orchestrator.py               115     35    70%
src/mitocode/backend/agent/agent_runtime.py                     91      0   100%
src/mitocode/backend/agent/agent_session.py                    133      1    99%
src/mitocode/backend/agent/agent_state.py                        8      0   100%
src/mitocode/backend/agent/session_factory.py                    6      0   100%
src/mitocode/backend/bridge/__init__.py                          2      0   100%
src/mitocode/backend/bridge/event_adapter.py                    25      0   100%
src/mitocode/backend/chat_provider/__init__.py                   4      0   100%
src/mitocode/backend/chat_provider/chat_provider_openai.py      50     34    32%
src/mitocode/backend/chat_provider/sample_chat_provider.py      39     18    54%
src/mitocode/backend/exception/__init__.py                       2      0   100%
src/mitocode/backend/exception/mitocode_exception.py            19      0   100%
src/mitocode/backend/tool/__init__.py                            2      0   100%
src/mitocode/backend/tool/tool_manager.py                      105     28    73%
src/mitocode/backend/workspace/__init__.py                       3      0   100%
src/mitocode/backend/workspace/migration.py                     77     39    49%
src/mitocode/backend/workspace/snapshot.py                       0      0   100%
src/mitocode/backend/workspace/workspace.py                    180     11    94%
--------------------------------------------------------------------------------
TOTAL                                                          886    166    81%
Coverage XML written to file coverage.xml
Required test coverage of 80% reached. Total coverage: 81.26%
============================= 144 passed in 1.29s ==============================
🔒 gitleaks 详细
[]
📝 pyright 输出
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_runtime.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_runtime.py:91:32 - error: "Dict[Unknown, Unknown]" is not iterable
    "__aiter__" method not defined (reportGeneralTypeIssues)
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_session.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_session.py:133:41 - error: Type "Unknown | None" is not assignable to declared type "_SampleChatProvider"
    Type "Unknown | None" is not assignable to type "_SampleChatProvider"
      "None" is not assignable to "_SampleChatProvider" (reportAssignmentType)
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py:75:35 - error: Parameter declaration "path" is obscured by a declaration of the same name (reportRedeclaration)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py:92:54 - error: Operator "/" not supported for types "Path | str" and "Literal['.mitocode']"
    Operator "/" not supported for types "str" and "Literal['.mitocode']" (reportOperatorIssue)
/home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:286:13 - error: Argument of type "VisualType" cannot be assigned to parameter "renderable" of type "RenderableType" in function "__init__"
    Type "VisualType" is not assignable to type "RenderableType"
      Type "SupportsVisual" is not assignable to type "RenderableType"
        "SupportsVisual" is incompatible with protocol "ConsoleRenderable"
          "__rich_console__" is not present
        "SupportsVisual" is incompatible with protocol "RichCast"
          "__rich__" is not present
        "SupportsVisual" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:326:15 - error: Type "reactive[str]" is not assignable to declared type "property"
    "reactive[str]" is not assignable to "property" (reportAssignmentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:330:9 - error: Operator "+=" not supported for types "VisualType" and "str"
    Operator "+" not supported for types "ConsoleRenderable" and "str"
    Operator "+" not supported for types "RichCast" and "str"
    Operator "+" not supported for types "SupportsVisual" and "str"
    Operator "+" not supported for types "Visual" and "str" (reportOperatorIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:330:14 - error: "content" incorrectly overrides property of same name in class "Static" (reportIncompatibleMethodOverride)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:334:26 - error: Argument of type "VisualType" cannot be assigned to parameter "markup" of type "str" in function "__init__"
    Type "VisualType" is not assignable to type "str"
      "ConsoleRenderable" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:346:15 - error: Type "reactive[str]" is not assignable to declared type "property"
    "reactive[str]" is not assignable to "property" (reportAssignmentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:350:9 - error: Operator "+=" not supported for types "VisualType" and "str"
    Operator "+" not supported for types "ConsoleRenderable" and "str"
    Operator "+" not supported for types "RichCast" and "str"
    Operator "+" not supported for types "SupportsVisual" and "str"
    Operator "+" not supported for types "Visual" and "str" (reportOperatorIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:350:14 - error: "content" incorrectly overrides property of same name in class "Static" (reportIncompatibleMethodOverride)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:354:26 - error: Argument of type "VisualType" cannot be assigned to parameter "markup" of type "str" in function "__init__"
    Type "VisualType" is not assignable to type "str"
      "ConsoleRenderable" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:428:35 - error: Cannot access attribute "append" for class "Static"
    Attribute "append" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:441:35 - error: Cannot access attribute "append" for class "Static"
    Attribute "append" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:483:35 - error: Cannot access attribute "append_code" for class "Static"
    Attribute "append_code" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:495:23 - error: Cannot access attribute "finalize" for class "Static"
    Attribute "finalize" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:497:23 - error: Cannot access attribute "end" for class "Static"
    Attribute "end" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:756:17 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:756:31 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:757:32 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:758:18 - error: "select_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:759:18 - error: "scroll_to_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:822:25 - error: "select_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:823:25 - error: "scroll_to_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:902:31 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:908:33 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:931:29 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:991:24 - error: Object of type "None" is not subscriptable (reportOptionalSubscript)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:993:31 - error: "get" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:997:25 - error: "set_widgets" is not a known attribute of "None" (reportOptionalMemberAccess)
31 errors, 0 warnings, 0 informations

自动提交状态: 无变更可提交


由 CI 自动生成

@github-actions

Copy link
Copy Markdown
Contributor

CI 检查结果汇总

  • pytest: ✅ 通过 — 144 个测试,
    errors=0, failures=0, skipped=0
  • 覆盖率: ✅ 通过 — 81.26%(720/886 行)
  • gitleaks: ✅ 通过 — 发现 0 条潜在泄露
  • black: ✅ 已应用格式化 — 已自动格式化代码
  • pylint: ✅ 通过 — 评分 9.63/10,共 52 条问题

信息展示

  • pyright: 31 个 error, 0 个 warning
📋 pytest 详细
============================= test session starts ==============================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.7.0
rootdir: /home/runner/work/MitoCode/MitoCode
configfile: pyproject.toml
plugins: asyncio-1.4.0, platformdirs-4.13.3, cov-7.1.0, anyio-4.15.1
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 144 items

test/test_agent_runtime.py ............................                  [ 19%]
test/test_agent_session.py ............................................. [ 50%]
............                                                             [ 59%]
test/test_main.py .                                                      [ 59%]
test/test_orchestrator_and_bridge.py ............                        [ 68%]
test/test_tool_manager.py ......                                         [ 72%]
test/test_workspace.py ......................................            [ 98%]
test/test_workspace_async.py ..                                          [100%]

------ generated xml file: /home/runner/work/MitoCode/MitoCode/report.xml ------
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.14.8-final-0 ________________

Name                                                         Stmts   Miss  Cover
--------------------------------------------------------------------------------
src/mitocode/__init__.py                                         4      0   100%
src/mitocode/backend/__init__.py                                 3      0   100%
src/mitocode/backend/agent/__init__.py                           8      0   100%
src/mitocode/backend/agent/agent_node.py                        10      0   100%
src/mitocode/backend/agent/agent_orchestrator.py               115     35    70%
src/mitocode/backend/agent/agent_runtime.py                     91      0   100%
src/mitocode/backend/agent/agent_session.py                    133      1    99%
src/mitocode/backend/agent/agent_state.py                        8      0   100%
src/mitocode/backend/agent/session_factory.py                    6      0   100%
src/mitocode/backend/bridge/__init__.py                          2      0   100%
src/mitocode/backend/bridge/event_adapter.py                    25      0   100%
src/mitocode/backend/chat_provider/__init__.py                   4      0   100%
src/mitocode/backend/chat_provider/chat_provider_openai.py      50     34    32%
src/mitocode/backend/chat_provider/sample_chat_provider.py      39     18    54%
src/mitocode/backend/exception/__init__.py                       2      0   100%
src/mitocode/backend/exception/mitocode_exception.py            19      0   100%
src/mitocode/backend/tool/__init__.py                            2      0   100%
src/mitocode/backend/tool/tool_manager.py                      105     28    73%
src/mitocode/backend/workspace/__init__.py                       3      0   100%
src/mitocode/backend/workspace/migration.py                     77     39    49%
src/mitocode/backend/workspace/snapshot.py                       0      0   100%
src/mitocode/backend/workspace/workspace.py                    180     11    94%
--------------------------------------------------------------------------------
TOTAL                                                          886    166    81%
Coverage XML written to file coverage.xml
Required test coverage of 80% reached. Total coverage: 81.26%
============================= 144 passed in 1.08s ==============================
🔒 gitleaks 详细
[]
📝 pyright 输出
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_runtime.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_runtime.py:91:32 - error: "Dict[Unknown, Unknown]" is not iterable
    "__aiter__" method not defined (reportGeneralTypeIssues)
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_session.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/agent/agent_session.py:133:41 - error: Type "Unknown | None" is not assignable to declared type "_SampleChatProvider"
    Type "Unknown | None" is not assignable to type "_SampleChatProvider"
      "None" is not assignable to "_SampleChatProvider" (reportAssignmentType)
/home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py:75:35 - error: Parameter declaration "path" is obscured by a declaration of the same name (reportRedeclaration)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/backend/workspace/migration.py:92:54 - error: Operator "/" not supported for types "Path | str" and "Literal['.mitocode']"
    Operator "/" not supported for types "str" and "Literal['.mitocode']" (reportOperatorIssue)
/home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:286:13 - error: Argument of type "VisualType" cannot be assigned to parameter "renderable" of type "RenderableType" in function "__init__"
    Type "VisualType" is not assignable to type "RenderableType"
      Type "SupportsVisual" is not assignable to type "RenderableType"
        "SupportsVisual" is incompatible with protocol "ConsoleRenderable"
          "__rich_console__" is not present
        "SupportsVisual" is incompatible with protocol "RichCast"
          "__rich__" is not present
        "SupportsVisual" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:326:15 - error: Type "reactive[str]" is not assignable to declared type "property"
    "reactive[str]" is not assignable to "property" (reportAssignmentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:330:9 - error: Operator "+=" not supported for types "VisualType" and "str"
    Operator "+" not supported for types "ConsoleRenderable" and "str"
    Operator "+" not supported for types "RichCast" and "str"
    Operator "+" not supported for types "SupportsVisual" and "str"
    Operator "+" not supported for types "Visual" and "str" (reportOperatorIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:330:14 - error: "content" incorrectly overrides property of same name in class "Static" (reportIncompatibleMethodOverride)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:334:26 - error: Argument of type "VisualType" cannot be assigned to parameter "markup" of type "str" in function "__init__"
    Type "VisualType" is not assignable to type "str"
      "ConsoleRenderable" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:346:15 - error: Type "reactive[str]" is not assignable to declared type "property"
    "reactive[str]" is not assignable to "property" (reportAssignmentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:350:9 - error: Operator "+=" not supported for types "VisualType" and "str"
    Operator "+" not supported for types "ConsoleRenderable" and "str"
    Operator "+" not supported for types "RichCast" and "str"
    Operator "+" not supported for types "SupportsVisual" and "str"
    Operator "+" not supported for types "Visual" and "str" (reportOperatorIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:350:14 - error: "content" incorrectly overrides property of same name in class "Static" (reportIncompatibleMethodOverride)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:354:26 - error: Argument of type "VisualType" cannot be assigned to parameter "markup" of type "str" in function "__init__"
    Type "VisualType" is not assignable to type "str"
      "ConsoleRenderable" is not assignable to "str" (reportArgumentType)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:428:35 - error: Cannot access attribute "append" for class "Static"
    Attribute "append" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:441:35 - error: Cannot access attribute "append" for class "Static"
    Attribute "append" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:483:35 - error: Cannot access attribute "append_code" for class "Static"
    Attribute "append_code" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:495:23 - error: Cannot access attribute "finalize" for class "Static"
    Attribute "finalize" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:497:23 - error: Cannot access attribute "end" for class "Static"
    Attribute "end" is unknown (reportAttributeAccessIssue)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:756:17 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:756:31 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:757:32 - error: "root" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:758:18 - error: "select_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:759:18 - error: "scroll_to_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:822:25 - error: "select_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:823:25 - error: "scroll_to_node" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:902:31 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:908:33 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:931:29 - error: "value" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:991:24 - error: Object of type "None" is not subscriptable (reportOptionalSubscript)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:993:31 - error: "get" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/MitoCode/MitoCode/src/mitocode/tui/ui_main.py:997:25 - error: "set_widgets" is not a known attribute of "None" (reportOptionalMemberAccess)
31 errors, 0 warnings, 0 informations

自动提交状态: 无变更可提交


由 CI 自动生成

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.

3 participants