Skip to content

release/v5.7.3#76

Merged
code-crusher merged 8 commits intomainfrom
release/v5.7.3
Apr 2, 2026
Merged

release/v5.7.3#76
code-crusher merged 8 commits intomainfrom
release/v5.7.3

Conversation

@code-crusher
Copy link
Copy Markdown
Member

  • release/v5.7.1 (release/v5.7.1 #73)
  • release/v5.7.2 (release/v5.7.2 #74)
  • update readme (update readme #75)
  • feat: add file_write tool implementation
  • feat: add LSP tool for code definition navigation
  • feat(mcp): add OAuth authentication support for MCP servers
  • fix: allow changing 3p models for existing tasks and fix model display names
  • refactor(settings): modernize settings panel UI with new card-based design
  • style(ui): reduce VSCodeButton size by 5% across all variants
  • docs: update CHANGELOG.md for v5.7.3

- Add native file_write tool with safe write patterns
- Add fileWriteTool with validation and backup support
- Update tool definitions and exports
- Add i18n translations for file_write tool
- Add lspTool.ts with LSP tool implementation for go-to-definition functionality
- Add native tool prompt for LSP in native-tools/lsp.ts
- Update presentAssistantMessage to handle LSP tool responses
- Add LSP tool type and handler to tools.ts and ExtensionMessage.ts
- Update ChatRow.tsx to display LSP tool results
- Add i18n translations for LSP tool in chat.json
This commit introduces comprehensive OAuth 2.0 authentication support for MCP (Model Context Protocol) servers, enabling secure authentication flows for URL-based MCP connections.

Core Features:
- Add new 'mcp_authenticate' tool for initiating OAuth flows
- Implement OAuth provider with token storage, refresh, and validation
- Add OAuth callback handler for completing authentication flows
- Support for both SSE and Streamable HTTP server types

Changes to Core Systems:
- packages/types/src/tool.ts: Add 'mcp_authenticate' to tool names enum
- src/shared/tools.ts: Register mcp_authenticate tool definition
- src/shared/mcp.ts: Add McpAuthError, McpOAuthConfig, and McpOAuthTokens types
- src/shared/ExtensionMessage.ts: Add auth-related message types

MCP Infrastructure Updates:
- src/services/mcp/McpHub.ts: Major refactor to support OAuth-enabled connections
  - Add NeedsAuthMcpConnection state for servers requiring authentication
  - Implement OAuth token injection into request headers
  - Add automatic token refresh before expiration
  - Add OAuth configuration schema validation
- src/services/mcp/oauth-provider.ts: New OAuth provider service
  - Token storage and retrieval with encryption
  - Token validation and refresh logic
  - PKCE flow implementation for secure authentication
- src/services/mcp/oauth-callback.ts: New OAuth callback handler
  - HTTP server for handling OAuth callbacks
  - Token exchange and storage on successful auth

Tool Implementations:
- src/core/tools/mcpAuthenticateTool.ts: New tool for MCP authentication
  - Initiates OAuth flow for specified MCP server
  - Returns authorization URL for user to complete
- src/core/tools/useMcpToolTool.ts: Enhanced to handle auth errors
  - Detect McpAuthError responses
  - Prompt user to authenticate when tokens expire
- src/core/prompts/tools/mcp-authenticate.ts: New prompt definition
- src/core/prompts/tools/index.ts: Register mcp-authenticate prompt

Message Processing:
- src/core/assistant-message/AssistantMessageParser.ts: Handle mcp_authenticate tool blocks
- src/core/assistant-message/kilocode/native-tool-call.ts: Add native tool call support
- src/core/assistant-message/presentAssistantMessage.ts: Present auth requests to user
- src/api/providers/kilocode/nativeToolCallHelpers.ts: Helper for native auth tool calls

Task Management:
- src/core/task/Task.ts: Integrate mcp_authenticate into task execution flow

UI/UX Changes:
- webview-ui/src/components/chat/McpExecution.tsx: Enhanced to show auth states
  - Display authentication required indicators
  - Show OAuth flow progress
- webview-ui/src/components/chat/ChatRow.tsx: Handle mcp_authenticate message type
- webview-ui/src/components/chat/ChatView.tsx: Pass auth handlers to components
- webview-ui/src/components/kilocode/common/KiloCodeAuth.tsx: Reusable auth UI components
- webview-ui/src/i18n/locales/en/mcp.json: Add auth-related i18n strings
- webview-ui/src/index.css: Add styles for auth states and OAuth flow UI

Activation & Routing:
- src/activate/handleUri.ts: Handle OAuth callback URIs
  - Parse callback parameters
  - Route to appropriate OAuth completion handler

Stats: 19 files changed, 1221 insertions(+), 178 deletions(-)
…y names

- Add thirdPartySelectedModel parameter to Task.updateModel() to properly track 3p model selections
- Pass thirdPartySelectedModel through webviewMessageHandler for task-local model updates
- Clear thirdPartySelectedModel when switching from 3p to Axon models in ModelSelector
- Add provider prefixes (matterai3p:, ollama:, opencode:, fireworks:) to model IDs for consistent identification
- Fix TypeScript error with optional chaining for mainId in prettyModelName
…esign

Comprehensive UI/UX overhaul of the settings panel to improve visual consistency
and user experience across all settings sections.

Changes:
- Introduced new SettingsCard and SettingsRow components in ui/SettingsCard.tsx
  for a unified, card-based layout across all settings sections
- Replaced Section/SectionHeader pattern with SettingsCard/SettingsRow pattern
  in all 22 settings components for consistent styling
- Updated SettingsView.tsx:
  - Redesigned profile section with smaller avatar (8x8) and improved spacing
  - Added search bar placeholder for future search functionality
  - Updated tab styling with refined active state using VSCode theme colors
  - Changed active tab background to use vscode-list-inactiveSelectionBackground
  - Improved tab height and spacing (h-8, mb-0.5)
  - Added transition-colors for smoother tab interactions
- Refactored all settings sections:
  - About: Consolidated version info and support links into card layout
  - AutoApproveSettings: Streamlined toggle layout with SettingsRow
  - AutoApproveToggle: Simplified component structure
  - BrowserSettings: Reorganized into card-based sections
  - CheckpointSettings: Updated to use new card pattern
  - CodeReviewSettings: Migrated to SettingsCard/SettingsRow
  - CommitMessagePromptSettings: Updated layout
  - ContextManagementSettings: Refactored with new components
  - DisplaySettings: Modernized card layout
  - ExperimentalFeature: Simplified structure
  - ExperimentalSettings: Updated to use new pattern
  - FastApplySettings: Reorganized with SettingsRow
  - ImageGenerationSettings: Migrated to card-based design
  - LanguageSettings: Updated layout structure
  - NotificationSettings: Refactored with new components
  - PromptsSettings: Modernized card layout
  - SlashCommandsSettings: Updated to use SettingsCard
  - TerminalCommandGeneratorSettings: Refactored layout
  - TerminalSettings: Comprehensive reorganization with card pattern
  - ThirdPartyProviders: Updated to use new components
  - UISettings: Simplified with SettingsCard/SettingsRow

Visual Improvements:
- Consistent card backgrounds with bg-opacity-40
- Unified border styling using vscode-widget-border
- Standardized spacing and padding across all settings
- Improved toggle switches with better accessibility
- More compact and scannable layout

Technical:
- Removed dependencies on Section and SectionHeader components
- All settings now use the new ui/SettingsCard module
- Maintained all existing functionality and i18n support
- Preserved VSCode theme integration
- Fixed ESLint warnings for unused imports and parameters

Breaking: None - all changes are visual refactoring only
- Add global CSS overrides for all vscode-button appearances (primary, secondary, icon)
- Reduce button padding from default to 4px 9px for compact sizing
- Scale font-size to 95% of vscode-font-size for consistent 5% reduction
- Set min-height (22px) and max-height (28px) constraints on button controls
- Apply line-height of 1.35 for better text vertical alignment
- Use ::part(control) selector to target internal button shadow DOM elements
- Maintain existing primary button color overrides while applying size changes
@code-crusher
Copy link
Copy Markdown
Member Author

/matter summary

@matter-ai-bot
Copy link
Copy Markdown
Contributor

matter-ai-bot bot commented Apr 2, 2026

Summary By MatterAI MatterAI logo

🔄 What Changed

This release (v5.7.3) introduces a robust OAuth authentication flow for MCP servers, enabling secure connections to remote tools. It adds two major capabilities: the file_write tool for atomic file creation/overwrites and the lsp tool for direct Language Server Protocol interactions. Additionally, the Settings UI has been completely redesigned with a modern card-based layout, and the model name formatting logic was overhauled to support complex provider paths and tags.

🔍 Impact of the Change

Users can now authenticate with remote MCP servers via browser-based OAuth, significantly expanding the ecosystem of usable tools. The file_write tool improves AI reliability by preventing partial edits on complex files. The UI refactor provides a more intuitive, native VS Code experience, while the integration of MCP tool schemas directly into LLM requests ensures higher accuracy in tool parameter generation.

📁 Total Files Changed

Click to Expand
File ChangeLog
Model Formatting cli/src/constants/providers/models.ts Enhanced prettyModelName to handle 3-part paths, tags, and provider prefixes.
OAuth Logic src/services/mcp/McpHub.ts Implemented OAuth flow management, token persistence, and Bearer token injection.
New Tool src/core/tools/fileWriteTool.ts Added atomic file writing with line-count verification and diff-view integration.
LSP Integration src/core/tools/lspTool.ts Created tool to interface with VS Code's internal LSP providers for code intelligence.
UI Refactor webview-ui/src/components/settings/ui/SettingsCard.tsx Introduced new card, row, and switch primitives for the settings redesign.
Message Parsing src/core/assistant-message/AssistantMessageParser.ts Updated to convert native LLM tool calls into MCP-compatible formats dynamically.
OAuth Callback src/services/mcp/oauth-callback.ts Managed pending OAuth states and local HTTP callback server for token exchange.

🧪 Test Added/Recommended

Added

  • Comprehensive unit tests in cli/src/constants/providers/__tests__/models.test.ts covering multi-part paths, tags, and edge cases for model name formatting.

Recommended

  • Integration tests for the OAuth callback lifecycle to ensure token refresh logic handles network failures gracefully.
  • UI automation tests for the new Settings components to verify state persistence across tab switches.

🔒 Security Vulnerabilities

  • OAuth Security: Implemented PKCE (Proof Key for Code Exchange) and state-based CSRF protection for MCP authentication.
  • Path Validation: The file_write tool utilizes rooIgnore and workspace boundary checks to prevent unauthorized file system access. 🛡️

Copy link
Copy Markdown
Contributor

@matter-ai-bot matter-ai-bot bot left a comment

Choose a reason for hiding this comment

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

🧪 PR Review is completed: Found a runtime TypeError in the new file_write tool where a non-existent string method is called.

Skipped files
  • CHANGELOG.md: Skipped file pattern
  • webview-ui/src/i18n/locales/en/chat.json: Skipped file pattern
  • webview-ui/src/i18n/locales/en/mcp.json: Skipped file pattern

await cline.say(
"error",
`Axon Code tried to use file_write${
filePath ? ` for '${filePath.toPosix()}'` : ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 Bug

Issue: filePath is a string, and toPosix() is not a built-in string method in JavaScript/TypeScript. This will throw a TypeError at runtime when the error message is constructed.

Fix: Remove .toPosix() or use a utility function to convert the path format if needed. Since it's just for an error message, using filePath directly is fine.

Suggested change
filePath ? ` for '${filePath.toPosix()}'` : ""
filePath ? ` for '${filePath}'` : ""

@matter-ai-bot
Copy link
Copy Markdown
Contributor

matter-ai-bot bot commented Apr 2, 2026

Code Quality bug fix

Context

Summary By MatterAI MatterAI logo

🔄 What Changed

Enhanced the error reporting in fileWriteTool.ts by conditionally including the filePath in the error message when the line_count parameter is missing or truncated.

🔍 Impact of the Change

Improves debugging efficiency by providing specific context (the filename) in error logs, allowing developers to identify which file failed during multi-file write operations.

📁 Total Files Changed

Click to Expand
File ChangeLog
Error Logging src/core/tools/fileWriteTool.ts Added conditional string interpolation for filePath in the error message.

🧪 Test Added/Recommended

Recommended

  • Unit Test: Verify that the error message correctly includes the file path when provided and remains clean when filePath is undefined.

🔒 Security Vulnerabilities

N/A

Implementation

The change uses a ternary operator within a template literal to check for the existence of filePath before appending it to the error string sent to cline.say.

Screenshots

before after
N/A N/A

How to Test

  1. Trigger a file_write tool call with a missing line_count parameter.
  2. Verify the output message in the console/UI includes the specific file path.

Get in Touch

N/A

⏳ Estimated code review effort

LOW (~5 minutes)

Tip

Quality Recommendations

  1. Ensure the filePath variable is properly sanitized before logging to prevent potential log injection if the path is user-controlled.

♫ Tanka Poem

A path now appears, 📍
When the writing process fails, ❌
No more hidden fears, 👻
Logic follows clearer trails, 🗺️
Truth in code prevails. ⚖️

Sequence Diagram

sequenceDiagram
    participant S as System
    participant F as fileWriteTool
    participant C as cline
    
    S->>F: execute(params)
    Note over F: Validate line_count
    
    alt line_count missing or truncated
        F->>C: say("error", messageWithFilePath)
    end
Loading

@matter-ai-bot
Copy link
Copy Markdown
Contributor

matter-ai-bot bot commented Apr 2, 2026

✅ Reviewed the changes: The PR successfully resolves the previous TypeError by removing the invalid .toPosix() call on the filePath string.

@code-crusher code-crusher merged commit 4bc897c into main Apr 2, 2026
3 of 12 checks passed
@code-crusher code-crusher deleted the release/v5.7.3 branch April 2, 2026 07:49
@code-crusher
Copy link
Copy Markdown
Member Author

/matter help

@matter-ai-bot
Copy link
Copy Markdown
Contributor

matter-ai-bot bot commented Apr 2, 2026

Tip

MatterAI Commands

Here's how you can interact with MatterAI in your pull requests

📋 Available Commands

Code Review Commands

  • /matter review: Generate AI review for files changed in the latest commit only
  • /matter review-full: Generate AI review for all files in the PR

Documentation Commands

  • /matter summary: Generate a concise summary of the PR changes
  • /matter release-notes: Generate release notes based on the PR
  • /matter create-pr: Create a new PR implementing changes based on the current PR's summary and review

Collaboration Commands

  • /matter <your question>: Ask any question about the PR or codebase
  • /matter explain: Get an explanation of the PR
  • /matter remember <recommendation>: Save important context for future PRs

Help Commands

  • /matter help: Show this help message
🔍 How MatterAI Works
  • Smart Reviews: MatterAI analyzes only the changed files to provide focused feedback
  • Incremental Reviews: When using /matter review, only new commits since the last review are analyzed
  • Context-Aware: The AI understands your codebase and previous discussions
  • Customizable: Your team can configure review depth and style in organization settings

Visit Documentation

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