Skip to content

fix: restore MCP delivery and settings tooltips#1988

Merged
zerob13 merged 2 commits into
devfrom
codex/mcp-tool-result-reliability
Jul 16, 2026
Merged

fix: restore MCP delivery and settings tooltips#1988
zerob13 merged 2 commits into
devfrom
codex/mcp-tool-result-reliability

Conversation

@zerob13

@zerob13 zerob13 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • provide the shared tooltip context at the settings application root
  • migrate the built-in DeepChat Agent's legacy empty MCP allowlist before the first window opens
  • preserve plain-text MCP tool results when strict JSON parsing fails

Root cause

The built-in Agent could retain a historical enabledMcpServerIds: [] value, so Agent-scoped filtering removed every normal MCP tool even while MCP was globally enabled. Separately, tool-result conversion ran jsonrepair on arbitrary text; signed URLs containing https:// were interpreted as comments and truncated to https:.

Impact

Existing users recover globally enabled MCP tools on startup without disabling Agent-scoped filtering. MCP text responses, including signed image URLs, reach the provider unchanged. Settings controls also receive the required tooltip provider context.

Validation

  • pnpm run format
  • pnpm run i18n
  • pnpm run lint
  • pnpm run typecheck
  • 87 focused main-process tests passed; 2 environment-gated SQLite tests skipped
  • 10 AI SDK message-mapper tests passed

Summary by CodeRabbit

  • Bug Fixes

    • Restored access to MCP tools in sessions affected by legacy built-in Agent settings.
    • Preserved intentional configurations that disable all MCP servers.
    • Fixed tool results containing URLs or other plain text so they display correctly instead of being misinterpreted as JSON.
  • User Experience

    • Improved tooltip behavior across the Settings page for more consistent help text and interaction.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 56a297e9-1eca-4bda-a35c-fac686c6ad59

📥 Commits

Reviewing files that changed from the base of the PR and between 65c937b and 6f94556.

📒 Files selected for processing (8)
  • docs/issues/mcp-tools-filtered-by-legacy-allowlist/spec.md
  • src/main/app/composition.ts
  • src/main/app/startupMigrations/sessionDataMigrations.ts
  • src/main/provider/aiSdk/toolProtocol.ts
  • src/renderer/settings/App.vue
  • test/main/app/compositionBoundaries.test.ts
  • test/main/app/startupMigrations/sessionDataMigrations.test.ts
  • test/main/provider/aiSdkMessageMapper.test.ts

📝 Walkthrough

Walkthrough

Adds a retryable built-in MCP allowlist startup migration, switches tool-result strings to strict JSON parsing, and wraps the settings page in a delayed tooltip provider.

Changes

Built-in MCP allowlist migration

Layer / File(s) Summary
Migration behavior and validation
src/main/app/startupMigrations/sessionDataMigrations.ts, docs/issues/.../spec.md, test/main/app/startupMigrations/sessionDataMigrations.test.ts
Defines the compatibility migration, converts legacy empty built-in allowlists to null, records status and errors, and tests idempotency, preservation, and retry behavior.
Startup migration wiring and ordering
src/main/app/composition.ts, test/main/app/compositionBoundaries.test.ts
Runs the migration after ACP registry migration and before initial chat window creation.

Tool-result output parsing

Layer / File(s) Summary
Strict tool-result conversion
src/main/provider/aiSdk/toolProtocol.ts, test/main/provider/aiSdkMessageMapper.test.ts
Uses direct JSON parsing for string tool results and preserves non-JSON URL strings as text.

Settings tooltip context

Layer / File(s) Summary
Settings tooltip provider
src/renderer/settings/App.vue
Wraps the settings page content in a TooltipProvider with a 200ms delay.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AppStartup
  participant SessionDataMigrationSQLite
  participant AgentSettings
  AppStartup->>SessionDataMigrationSQLite: Read migration status
  AppStartup->>SessionDataMigrationSQLite: Write running status
  AppStartup->>AgentSettings: Read deepchat agent config
  AgentSettings-->>AppStartup: Return enabledMcpServerIds
  AppStartup->>AgentSettings: Convert [] to null when applicable
  AppStartup->>SessionDataMigrationSQLite: Write completed or failed status
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: MCP delivery restoration and settings tooltip context.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/mcp-tool-result-reliability

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zerob13
zerob13 marked this pull request as ready for review July 16, 2026 16:02
@zerob13
zerob13 merged commit b6625d2 into dev Jul 16, 2026
4 checks passed
@zhangmo8
zhangmo8 deleted the codex/mcp-tool-result-reliability branch July 17, 2026 03:07
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