mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
Merge branch 'main' into feature/arena-agent-collaboration
This commit is contained in:
commit
eff6543d05
109 changed files with 3861 additions and 2407 deletions
|
|
@ -348,7 +348,7 @@ describe('Settings Loading and Merging', () => {
|
|||
fileName: 'WORKSPACE_CONTEXT.md',
|
||||
},
|
||||
mcp: {
|
||||
allowed: ['server1', 'server2'],
|
||||
allowed: ['server1', 'server2', 'server3', 'server1', 'server2'],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
@ -1474,8 +1474,8 @@ describe('Settings Loading and Merging', () => {
|
|||
const settings = loadSettings(MOCK_WORKSPACE_DIR);
|
||||
|
||||
expect(settings.merged.mcp).toEqual({
|
||||
allowed: ['system-allowed'],
|
||||
excluded: ['workspace-excluded'],
|
||||
allowed: ['user-allowed', 'workspace-allowed', 'system-allowed'],
|
||||
excluded: ['user-excluded', 'workspace-excluded'],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ import {
|
|||
QWEN_DIR,
|
||||
getErrorMessage,
|
||||
Storage,
|
||||
setDebugLogSession,
|
||||
sanitizeCwd,
|
||||
createDebugLogger,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import stripJsonComments from 'strip-json-comments';
|
||||
|
|
@ -476,16 +474,6 @@ export function loadEnvironment(settings: Settings): void {
|
|||
export function loadSettings(
|
||||
workspaceDir: string = process.cwd(),
|
||||
): LoadedSettings {
|
||||
// Set up a temporary debug log session for the startup phase.
|
||||
// This allows migration errors to be logged to file instead of being
|
||||
// exposed to users via stderr. The Config class will override this
|
||||
// with the actual session once initialized.
|
||||
const resolvedWorkspaceDir = path.resolve(workspaceDir);
|
||||
const sanitizedProjectId = sanitizeCwd(resolvedWorkspaceDir);
|
||||
setDebugLogSession({
|
||||
getSessionId: () => `startup-${sanitizedProjectId}`,
|
||||
});
|
||||
|
||||
let systemSettings: Settings = {};
|
||||
let systemDefaultSettings: Settings = {};
|
||||
let userSettings: Settings = {};
|
||||
|
|
@ -496,7 +484,7 @@ export function loadSettings(
|
|||
const migratedInMemorScopes = new Set<SettingScope>();
|
||||
|
||||
// Resolve paths to their canonical representation to handle symlinks
|
||||
// Note: resolvedWorkspaceDir is already defined at the top of the function
|
||||
const resolvedWorkspaceDir = path.resolve(workspaceDir);
|
||||
const resolvedHomeDir = path.resolve(homedir());
|
||||
|
||||
let realWorkspaceDir = resolvedWorkspaceDir;
|
||||
|
|
|
|||
|
|
@ -998,6 +998,7 @@ const SETTINGS_SCHEMA = {
|
|||
default: undefined as string[] | undefined,
|
||||
description: 'A list of MCP servers to allow.',
|
||||
showInDialog: false,
|
||||
mergeStrategy: MergeStrategy.CONCAT,
|
||||
},
|
||||
excluded: {
|
||||
type: 'array',
|
||||
|
|
@ -1007,6 +1008,7 @@ const SETTINGS_SCHEMA = {
|
|||
default: undefined as string[] | undefined,
|
||||
description: 'A list of MCP servers to exclude.',
|
||||
showInDialog: false,
|
||||
mergeStrategy: MergeStrategy.CONCAT,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue