feat(councils-ui): add on-demand council conversations panel and model config controls

This commit is contained in:
William Valentin
2026-02-21 11:26:04 -08:00
parent cfd7fa6fd0
commit 7c121b82c6
11 changed files with 481 additions and 4 deletions
+122
View File
@@ -10,6 +10,47 @@ export interface ConfigHandlerDeps {
modelRouter?: ModelRouter;
}
function ensureCouncilsConfig(config: Config): NonNullable<Config['councils']> {
config.councils ??= {
enabled: false,
defaults: {
max_rounds: 2,
ideas_per_round: 6,
top_ideas_for_bridge: 3,
bridge_packet_max_chars: 2500,
bridge_field_max_bullets: 6,
bridge_entry_max_chars: 300,
novelty_delta_threshold: 10,
repetition_threshold: 70,
},
strict_grounding: false,
strict_meta_validation: true,
groups: {
D: {
arbiter_agent: 'council_d_arbiter',
freethinker_agent: 'council_d_freethinker',
model_tier: 'complex',
group_prompt_prefix: 'Optimize for feasibility and speed-to-test. Prefer boring-but-true.',
novelty_bias: 'low',
risk_tolerance: 'low',
forbidden_approaches: ['moonshots', 'handwavy AI claims', 'unverified assumptions'],
},
P: {
arbiter_agent: 'council_p_arbiter',
freethinker_agent: 'council_p_freethinker',
model_tier: 'complex',
group_prompt_prefix: 'Optimize for reframing and non-obvious leverage. Weird is fine; label speculation.',
novelty_bias: 'high',
risk_tolerance: 'high',
forbidden_approaches: ['incremental tweaks', 'obvious best practices', 'purely conventional solutions'],
},
},
meta_arbiter_agent: 'council_meta_arbiter',
meta_model_tier: 'complex',
};
return config.councils;
}
/**
* Redact sensitive values from config before returning.
* Replaces API keys, tokens, passwords, and other credentials with "***".
@@ -316,6 +357,87 @@ const PATCHABLE_KEYS: Record<string, (config: Config, value: unknown) => boolean
config.agents.background_models.complex_reasoning.fallback_tier = value;
return true;
},
'councils.enabled': (config, value) => {
if (typeof value !== 'boolean') {return false;}
const councils = ensureCouncilsConfig(config);
councils.enabled = value;
return true;
},
'councils.defaults.max_rounds': (config, value) => {
if (typeof value !== 'number' || !Number.isFinite(value) || value < 1 || value > 6) {return false;}
const councils = ensureCouncilsConfig(config);
councils.defaults.max_rounds = Math.floor(value);
return true;
},
'councils.groups.D.model_tier': (config, value) => {
if (value !== 'fast' && value !== 'default' && value !== 'complex' && value !== 'local') {return false;}
const councils = ensureCouncilsConfig(config);
councils.groups.D.model_tier = value;
return true;
},
'councils.groups.P.model_tier': (config, value) => {
if (value !== 'fast' && value !== 'default' && value !== 'complex' && value !== 'local') {return false;}
const councils = ensureCouncilsConfig(config);
councils.groups.P.model_tier = value;
return true;
},
'councils.meta_model_tier': (config, value) => {
if (value !== 'fast' && value !== 'default' && value !== 'complex' && value !== 'local') {return false;}
const councils = ensureCouncilsConfig(config);
councils.meta_model_tier = value;
return true;
},
'councils.groups.D.arbiter_agent': (config, value) => {
if (typeof value !== 'string' || value.trim().length === 0) {return false;}
const councils = ensureCouncilsConfig(config);
councils.groups.D.arbiter_agent = value.trim();
return true;
},
'councils.groups.D.freethinker_agent': (config, value) => {
if (typeof value !== 'string' || value.trim().length === 0) {return false;}
const councils = ensureCouncilsConfig(config);
councils.groups.D.freethinker_agent = value.trim();
return true;
},
'councils.groups.D.grounder_agent': (config, value) => {
if (typeof value !== 'string') {return false;}
const next = value.trim();
const councils = ensureCouncilsConfig(config);
councils.groups.D.grounder_agent = next.length > 0 ? next : undefined;
return true;
},
'councils.groups.P.arbiter_agent': (config, value) => {
if (typeof value !== 'string' || value.trim().length === 0) {return false;}
const councils = ensureCouncilsConfig(config);
councils.groups.P.arbiter_agent = value.trim();
return true;
},
'councils.groups.P.freethinker_agent': (config, value) => {
if (typeof value !== 'string' || value.trim().length === 0) {return false;}
const councils = ensureCouncilsConfig(config);
councils.groups.P.freethinker_agent = value.trim();
return true;
},
'councils.groups.P.grounder_agent': (config, value) => {
if (typeof value !== 'string') {return false;}
const next = value.trim();
const councils = ensureCouncilsConfig(config);
councils.groups.P.grounder_agent = next.length > 0 ? next : undefined;
return true;
},
'councils.meta_arbiter_agent': (config, value) => {
if (typeof value !== 'string' || value.trim().length === 0) {return false;}
const councils = ensureCouncilsConfig(config);
councils.meta_arbiter_agent = value.trim();
return true;
},
'councils.scaffold_path': (config, value) => {
if (typeof value !== 'string') {return false;}
const next = value.trim();
const councils = ensureCouncilsConfig(config);
councils.scaffold_path = next.length > 0 ? next : undefined;
return true;
},
'models.default.provider': (config, value) => {
if (!MODEL_PROVIDERS.includes(String(value) as ModelProvider)) {return false;}
config.models.default.provider = value as ModelProvider;