mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-17 04:14:32 +00:00
fix(websearch): honor disabled steering per launch
This commit is contained in:
1 parent
09757b418e
commit
abc3002e89
18 files changed
+165
-76
No files matched your search
@@ -5,7 +5,10 @@
|
||||
*/
|
||||
|
||||
import { fail, info } from '../../utils/ui';
|
||||
import { ensureWebSearchMcpForLaunch } from '../../utils/websearch-manager';
|
||||
import {
|
||||
ensureWebSearchMcpForLaunch,
|
||||
resolveWebSearchLaunchState,
|
||||
} from '../../utils/websearch-manager';
|
||||
import { ensureImageAnalysisMcpOrThrow } from '../../utils/image-analysis';
|
||||
import {
|
||||
ensureProfileHooks as ensureImageAnalyzerHooks,
|
||||
@@ -23,7 +26,8 @@ export async function runCopilotFlow(ctx: ProfileDispatchContext): Promise<void>
|
||||
resolveProfileContinuityInheritance,
|
||||
} = ctx;
|
||||
|
||||
ensureWebSearchMcpForLaunch();
|
||||
const webSearchLaunch = resolveWebSearchLaunchState();
|
||||
ensureWebSearchMcpForLaunch(webSearchLaunch.config);
|
||||
const imageAnalysisMcpReady = ensureImageAnalysisMcpOrThrow();
|
||||
if (resolvedTarget === 'claude') {
|
||||
if (imageAnalysisMcpReady) {
|
||||
@@ -60,7 +64,8 @@ export async function runCopilotFlow(ctx: ProfileDispatchContext): Promise<void>
|
||||
copilotConfig,
|
||||
remainingArgs,
|
||||
continuityInheritance.claudeConfigDir,
|
||||
claudeCli
|
||||
claudeCli,
|
||||
webSearchLaunch
|
||||
);
|
||||
process.exit(exitCode);
|
||||
}
|
||||
@@ -5,7 +5,10 @@
|
||||
*/
|
||||
|
||||
import { fail, info } from '../../utils/ui';
|
||||
import { ensureWebSearchMcpForLaunch } from '../../utils/websearch-manager';
|
||||
import {
|
||||
ensureWebSearchMcpForLaunch,
|
||||
resolveWebSearchLaunchState,
|
||||
} from '../../utils/websearch-manager';
|
||||
import { ensureProfileHooks as ensureImageAnalyzerHooks } from '../../utils/hooks/image-analyzer-profile-hook-injector';
|
||||
import { installImageAnalyzerHook } from '../../utils/hooks';
|
||||
import type { ProfileDispatchContext } from '../dispatcher-context';
|
||||
@@ -19,7 +22,8 @@ export async function runCursorFlow(ctx: ProfileDispatchContext): Promise<void>
|
||||
resolveProfileContinuityInheritance,
|
||||
} = ctx;
|
||||
|
||||
ensureWebSearchMcpForLaunch();
|
||||
const webSearchLaunch = resolveWebSearchLaunchState();
|
||||
ensureWebSearchMcpForLaunch(webSearchLaunch.config);
|
||||
installImageAnalyzerHook();
|
||||
ensureImageAnalyzerHooks({
|
||||
profileName: profileInfo.name,
|
||||
@@ -48,7 +52,8 @@ export async function runCursorFlow(ctx: ProfileDispatchContext): Promise<void>
|
||||
cursorConfig,
|
||||
remainingArgs,
|
||||
continuityInheritance.claudeConfigDir,
|
||||
claudeCli
|
||||
claudeCli,
|
||||
webSearchLaunch
|
||||
);
|
||||
process.exit(exitCode);
|
||||
}
|
||||
@@ -16,10 +16,10 @@ import {
|
||||
import {
|
||||
ensureWebSearchMcpForLaunch,
|
||||
displayWebSearchStatus,
|
||||
getWebSearchHookEnv,
|
||||
syncWebSearchMcpToConfigDir,
|
||||
appendThirdPartyWebSearchToolArgs,
|
||||
createWebSearchTraceContext,
|
||||
resolveWebSearchLaunchState,
|
||||
} from '../../utils/websearch-manager';
|
||||
import {
|
||||
ensureImageAnalysisMcpOrThrow,
|
||||
@@ -94,18 +94,16 @@ export async function runSettingsFlow(ctx: ProfileDispatchContext): Promise<void
|
||||
if (browserAttachRuntime?.warning) {
|
||||
process.stderr.write(`${warn(browserAttachRuntime.warning)}\n`);
|
||||
}
|
||||
let shouldDisplayWebSearchStatus = true;
|
||||
const webSearchLaunch = resolveWebSearchLaunchState();
|
||||
if (resolvedTarget === 'claude') {
|
||||
shouldDisplayWebSearchStatus = ensureWebSearchMcpForLaunch();
|
||||
ensureWebSearchMcpForLaunch(webSearchLaunch.config);
|
||||
if (browserRuntimeEnv) {
|
||||
ensureBrowserMcpOrThrow();
|
||||
}
|
||||
}
|
||||
|
||||
// Display WebSearch status (single line, equilibrium UX)
|
||||
if (shouldDisplayWebSearchStatus) {
|
||||
displayWebSearchStatus();
|
||||
}
|
||||
displayWebSearchStatus(webSearchLaunch.config);
|
||||
|
||||
const continuityInheritance =
|
||||
resolvedTarget === 'claude'
|
||||
@@ -275,7 +273,7 @@ export async function runSettingsFlow(ctx: ProfileDispatchContext): Promise<void
|
||||
targetRemainingArgs,
|
||||
});
|
||||
|
||||
const webSearchEnv = getWebSearchHookEnv();
|
||||
const webSearchEnv = webSearchLaunch.hookEnv;
|
||||
|
||||
// Get global env vars (DISABLE_TELEMETRY, etc.) for third-party profiles
|
||||
const globalEnvConfig = getGlobalEnvConfig();
|
||||
@@ -395,11 +393,11 @@ export async function runSettingsFlow(ctx: ProfileDispatchContext): Promise<void
|
||||
? stripClaudeSubcommandSessionArgs(browserArgs)
|
||||
: browserArgs;
|
||||
const launchArgs = isSubcommand
|
||||
? appendThirdPartyWebSearchToolArgs(subcommandArgs)
|
||||
? appendThirdPartyWebSearchToolArgs(subcommandArgs, webSearchLaunch.enabled)
|
||||
: [
|
||||
'--settings',
|
||||
launchSettings.settingsPath,
|
||||
...appendThirdPartyWebSearchToolArgs(browserArgs),
|
||||
...appendThirdPartyWebSearchToolArgs(browserArgs, webSearchLaunch.enabled),
|
||||
];
|
||||
const traceEnv = createWebSearchTraceContext({
|
||||
launcher: 'ccs.settings-profile.proxy',
|
||||
@@ -418,8 +416,12 @@ export async function runSettingsFlow(ctx: ProfileDispatchContext): Promise<void
|
||||
const isSubcommand = isClaudeSubcommandInvocation(browserArgs);
|
||||
const subcommandArgs = isSubcommand ? stripClaudeSubcommandSessionArgs(browserArgs) : browserArgs;
|
||||
const launchArgs = isSubcommand
|
||||
? appendThirdPartyWebSearchToolArgs(subcommandArgs)
|
||||
: ['--settings', expandedSettingsPath, ...appendThirdPartyWebSearchToolArgs(browserArgs)];
|
||||
? appendThirdPartyWebSearchToolArgs(subcommandArgs, webSearchLaunch.enabled)
|
||||
: [
|
||||
'--settings',
|
||||
expandedSettingsPath,
|
||||
...appendThirdPartyWebSearchToolArgs(browserArgs, webSearchLaunch.enabled),
|
||||
];
|
||||
const traceEnv = createWebSearchTraceContext({
|
||||
launcher: 'ccs.settings-profile',
|
||||
args: launchArgs,
|
||||
|
||||
Reference in new issue
Block a user