Skip to content

feat: Gemini AI assistant and local MCP server - #2375

Draft
makarworld wants to merge 23 commits into
RimSort:mainfrom
makarworld:feat/ai-assistant-mcp
Draft

makarworld wants to merge 23 commits into
RimSort:mainfrom
makarworld:feat/ai-assistant-mcp

Conversation

@makarworld

Copy link
Copy Markdown
Contributor

Summary

  • AI Assistant panel — non-blocking chat window with Gemini provider, model picker (RPM/RPD hints), API key/proxy settings, persistent chat history, and tool calling against RimSort mod context (installed/active mods, dependencies, logs).
  • MCP server — optional local HTTP subprocess (--mcp / Settings → Advanced) exposing tools for external agents: list/describe/search mods, read logs, queue download/sort/save/run, and search_workshop_mods via Steam Web API.
  • Settings & UI — MCP port/token + Cursor config snippet; menubar AI Assistant action; Russian translations for new strings.

Test plan

  • Open AI Assistant from menubar, send a message with a valid Gemini API key
  • Toggle MCP server in Settings → Advanced, verify config snippet and agent can connect on http://127.0.0.1:17342/mcp
  • Call list_installed_mods / list_active_mods from an MCP client
  • With steam_apikey configured, call search_workshop_mods
  • Run: uv run pytest tests/ai tests/mcp tests/windows/test_ai_assistant_panel.py tests/utils/steam/test_workshop_search.py

makarworld and others added 4 commits August 20, 2026 07:12
Unify Workshop browse inject, missing-dependency Download/Workshop actions, mod-list import, SteamCMD logging, and Russian wiki pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fix mod list parser empty ModsConfig, dependency dialog tests, and lupdate extraction for settings section labels. Wrap remaining hardcoded UI strings and fill locales/ru_RU.ts (1458 entries).

Co-authored-by: Cursor <cursoragent@cursor.com>
Deduplicate missing-dependencies dialog docstrings, harden workshop URL parsing, and add targeted unit tests for dependency resolution, mod list parsing, dialog UI logic, and check_dependencies flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce a non-blocking AI chat panel with tool calling against RimSort
mod context, plus an optional HTTP MCP server for external agents (list/describe
mods, queue downloads/sort/save/run, workshop search).

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.16937% with 566 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
app/windows/ai_assistant_panel.py 51.21% 140 Missing ⚠️
app/mcp/server.py 41.77% 92 Missing ⚠️
app/mcp/rim_sort_context.py 84.87% 44 Missing ⚠️
app/ai/tools/mod_context.py 16.27% 36 Missing ⚠️
app/ai/tools/mod_tools.py 35.71% 36 Missing ⚠️
app/mcp/tools.py 68.96% 36 Missing ⚠️
app/mcp/command_queue.py 69.23% 24 Missing ⚠️
app/ai/gemini_provider.py 81.19% 22 Missing ⚠️
app/ai/tools/localization_finder.py 85.61% 21 Missing ⚠️
app/ai/proxy.py 79.16% 20 Missing ⚠️
... and 12 more
Files with missing lines Coverage Δ
app/ai/gemini_models.py 100.00% <100.00%> (ø)
app/ai/provider_base.py 100.00% <100.00%> (ø)
app/models/settings.py 57.97% <100.00%> (+0.99%) ⬆️
app/views/menu_bar.py 94.22% <100.00%> (+0.13%) ⬆️
app/controllers/menu_bar_controller.py 73.23% <66.66%> (-0.15%) ⬇️
app/views/main_window.py 28.71% <50.00%> (+0.73%) ⬆️
app/ai/chat_store.py 92.50% <92.50%> (ø)
app/mcp/__main__.py 0.00% <0.00%> (ø)
app/utils/steam/workshop_validate.py 90.32% <90.32%> (ø)
app/utils/steam/workshop_search.py 86.95% <86.95%> (ø)
... and 16 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@makarworld
makarworld marked this pull request as draft August 20, 2026 06:59
makarworld and others added 13 commits August 20, 2026 10:02
Add tools to search Russian localizations for active mods and validate Steam Workshop IDs before download. Relax validation for metadata-only API responses while rejecting cross-app IDs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Show tool call traces in chat, progress bar for localization search, live Steam API key override, and stricter system prompts to prevent hallucinated workshop IDs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Merge workshop-branch Russian locale base with new AI assistant strings and ignore .cursor in git.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Use setattr for method mocks in test_runner_panel.py to satisfy mypy. Add unit tests for mod list parser, dependency resolver, browser URL helpers, SteamCMD log tail edge cases, and wrapper console_log_path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extract shared alternative package ID test setup into _make_alt_dependency_metadata so jscpd zero-threshold CI passes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match zh-cn permalink/parent pattern so Russian pages map to /ru/faq/ and user-guide/. Add per-locale UI strings for nav external links, back-to-top, and GitHub edit link.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add Russian translations for DB Builder, Rule Editor, sorting algorithms, databases, CLI reference, and Acknowledgements. Minor copy edits to downloading-and-installing.ru.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
Disable parallel_localization for local Jekyll serve on Windows where fork() is unavailable. Use with: bundle exec jekyll serve --config _config.yml,_config_local.yml

Co-authored-by: Cursor <cursoragent@cursor.com>
Previous regen used bare pyside6-lupdate instead of
translation_helper.py, adding <location> tags and re-flowing every
existing entry across all 10 locales (~18k lines of noise).
- fix log_message override signature, unbound-self test call, socket
  address types and generator-return annotations flagged by pyright
- annotate bare dict/Callable generics and missing param/return types
  for mypy strict mode
- dedupe repeated tool-schema, query-parsing and mod-lookup code in
  app/mcp; extract shared test fixtures/helpers to clear jscpd's 0%
  duplication threshold
- apply ruff --fix/format across the diff
@github-actions github-actions Bot added the documentation 📚 related to Docs like wiki page README, changelog label Aug 20, 2026
makarworld and others added 6 commits August 21, 2026 01:37
Snapshot before starting AI UI fixes plan (dropdown download selector,
bubble sizing, i18n) so work can continue in an isolated worktree.
# Conflicts:
#	locales/ru_RU.qm
#	locales/ru_RU.ts
- MissingDependenciesDialog: replace plain "Download Selected" button
  with a dropdown (SteamCMD / Steam client), moved next to the other
  action buttons; wire the Steam client path through
  main_content_panel and main_window_controller.
- AiAssistantPanel: size chat bubbles to their content (min/max width
  via idealWidth, height via document size), block internal wheel
  scroll, and size "+ mod" buttons to match their bubble width.
- Compile ru_RU.qm from ru_RU.ts, add missing AiAssistantPanel /
  MissingDependenciesDialog / ModDownloadListWidget translations.
feat(ai): dropdown download selector, bubble autosize, ru i18n
- eventFilter blocked all wheel events on bubbles instead of forwarding
  them to the chat scroll area, so hovering a message froze scrolling.
- Mod links in chat had no tooltip; reuse the existing enriched-details
  fetch (image/author/tags) that previously only fed the download list.
- Pagination in _make_mod_link_buttons_row deleted old "+ mod" buttons
  via deleteLater without removing them from _mod_buttons, so a later
  style refresh touched an already-destroyed QPushButton and crashed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 📚 related to Docs like wiki page README, changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant