fix: persist dedicated physique targeting settings

This commit is contained in:
jjbrunton committed 2026-08-10 18:44:17 +01:00
1 parent 5c57ed337b
commit 8ea1cf16d4
3 files changed
+41 -2

No files matched your search

+12 -2
View File
@@ -16,7 +16,8 @@ const AdvancedConfigSchema = z.strictObject({
prioritizeRecentPosts: true,
recentWindowMinutes: true,
maxReadyCandidates: true,
}),
physiqueTargeting: true,
}).extend({ physiqueTargeting: PhysiqueTargetingSchema.optional() }),
openrouter: ConfigSchema.shape.openrouter.omit({ apiKey: true }),
browser: z.strictObject({ sessionDir: z.string() }),
conversations: ConfigSchema.shape.conversations,
@@ -31,6 +32,7 @@ function advancedConfig(ctx: WebContext): z.infer<typeof AdvancedConfigSchema> {
prioritizeRecentPosts: _prioritize,
recentWindowMinutes: _window,
maxReadyCandidates: _maxReady,
physiqueTargeting: _physiqueTargeting,
...reddit
} = ctx.config.reddit;
const { apiKey: _apiKey, ...openrouter } = ctx.config.openrouter;
@@ -158,7 +160,15 @@ export function createConfigRouter(ctx: WebContext): Router {
}
if (parsedAdvanced?.success) {
Object.assign(ctx.config.reddit, parsedAdvanced.data.reddit);
// Physique targeting has dedicated controls and is deliberately not
// owned by the advanced JSON. Cached dashboard bundles may still send
// an older copy here, so accept it but never let it overwrite the
// explicitly parsed top-level setting.
const {
physiqueTargeting: _legacyPhysiqueTargeting,
...advancedReddit
} = parsedAdvanced.data.reddit;
Object.assign(ctx.config.reddit, advancedReddit);
Object.assign(ctx.config.openrouter, parsedAdvanced.data.openrouter);
Object.assign(ctx.config.browser, parsedAdvanced.data.browser);
// Assigned field by field, never replaced: running account runtimes