feat(FN-4080): complete Step 1 — add thinking persistence resolver

Fusion-Task-Id: FN-4080
Fusion-Task-Lineage: 086863ba-7100-41ab-9cfc-197301fbcab0
This commit is contained in:
Fusion
2026-05-13 05:36:47 -07:00
committed by gsxdsm
parent 511253915c
commit e15035797d
5 changed files with 81 additions and 4 deletions

View File

@@ -87,6 +87,8 @@ export const DEFAULT_GLOBAL_SETTINGS = {
vitestKillThresholdPct: 90,
// Agent log persistence controls
persistAgentToolOutput: true,
persistAgentThinkingLogPermanent: false,
persistAgentThinkingLogEphemeral: false,
persistAgentThinkingLog: false,
researchGlobalDefaults: {
searchProvider: undefined,
@@ -363,3 +365,16 @@ export function isProjectSettingsKey(key: string): key is keyof ProjectSettings
export function isGlobalOnlySettingsKey(key: string): key is keyof GlobalSettings {
return isGlobalSettingsKey(key) && !isProjectSettingsKey(key);
}
export function resolvePersistAgentThinkingLog(
settings: Partial<GlobalSettings> | undefined,
opts: { ephemeral: boolean },
): boolean {
const granular = opts.ephemeral
? settings?.persistAgentThinkingLogEphemeral
: settings?.persistAgentThinkingLogPermanent;
if (typeof granular === "boolean") return granular;
if (typeof settings?.persistAgentThinkingLog === "boolean") return settings.persistAgentThinkingLog;
return false;
}