Skip to content

Conversation

@continue-development-app
Copy link

@continue-development-app continue-development-app bot commented Dec 26, 2025

Overview

This PR adds comprehensive test coverage for the allowHeadless feature introduced in PR #9328. The new tests ensure robust behavior of MCP tools in headless mode across various scenarios.

Test Coverage Added

1. Edge Cases and Error Handling

  • Disconnected MCP servers
  • Empty connections array
  • MCP server with empty tools array
  • Explicit allowHeadless: false behavior

2. Permission Policy Interactions

  • Wildcard exclude policies vs allowHeadless
  • Specific allow vs wildcard ask policies
  • allowHeadless with wildcard ask policy
  • Wildcard ask without allowHeadless in headless mode
  • argumentMatches with allowHeadless

3. Integration Tests

  • Mixed built-in and MCP tools in headless mode
  • Tool order preservation when filtering
  • Interactive to headless mode transition

4. Built-in Tool Behavior

  • Built-in tools work in headless mode regardless of allowHeadless flag

Key Improvements

  1. Comprehensive edge case coverage: Tests error conditions and boundary cases
  2. Permission policy interactions: Validates complex policy scenarios with wildcards
  3. Integration testing: Ensures components work together correctly
  4. Real-world scenarios: Tests common use cases like multiple mixed servers
  5. Security validation: Explicitly tests that security policies cannot be bypassed

Security-Critical Tests

✅ Explicit exclusions always respected (cannot be bypassed by allowHeadless)
✅ Wildcard excludes take precedence over allowHeadless
✅ Default behavior is secure (tools excluded without explicit allowHeadless: true)

Test Organization

Tests are organized into 4 logical groups:

Files Modified

  • extensions/cli/src/stream/mcp-headless.test.ts: Added 12 new test cases
  • TEST_IMPROVEMENTS.md: Documentation of test improvements

Test Statistics

  • Original tests: 9 test cases
  • New tests: 12 test cases
  • Total coverage: 21 test cases

This task was co-authored by peter-parker and Continue.


Summary by cubic

Added 12 tests that verify MCP allowHeadless behavior in headless mode. Improves security guarantees and covers real-world scenarios.

  • Test Coverage
    • Edge cases: disconnected servers, empty connections/tools, explicit allowHeadless: false.
    • Policies: wildcard exclude precedence, wildcard ask with/without allowHeadless, argumentMatches.
    • Integration: mixed built-in + MCP tools, order preservation, interactive→headless transition.
    • Built-in tools: always approved in headless mode.

Written for commit 981c13f. Summary will update automatically on new commits.

- Add edge case tests for disconnected servers, empty connections, and empty tools
- Add permission policy interaction tests with wildcards and argumentMatches
- Add integration tests for mixed built-in and MCP tools
- Add test for built-in tools behavior in headless mode
- Add tool ordering and mode transition tests

Improves test coverage for PR #9328 with 12 new test cases covering:
- Error handling and graceful degradation
- Complex permission policy scenarios
- Real-world integration scenarios
- Security boundary validation

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
Co-authored-by: peter-parker <[email protected]>
@continue-development-app continue-development-app bot requested a review from a team as a code owner December 26, 2025 15:42
@continue-development-app continue-development-app bot requested review from RomneyDa and removed request for a team December 26, 2025 15:42
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 26, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

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

Labels

continue-agent size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant