dual-brain 0.3.31 → 0.3.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/dual-brain.mjs +14 -0
  2. package/package.json +1 -1
@@ -1481,6 +1481,9 @@ async function cmdRuntimeSwitch(args = []) {
1481
1481
  let provider = _sessionTool(sess);
1482
1482
  let reason = 'head-runtime-switch';
1483
1483
  const confirmed = args.includes('--confirm') || args.includes('--go');
1484
+ const explicitModel = args.includes('--model') || args.includes('--head-model');
1485
+ const explicitEffort = args.includes('--effort');
1486
+ const explicitLevel = args.includes('--level') || args.includes('--intelligence') || args.includes('--intelligence-level');
1484
1487
 
1485
1488
  for (let i = 0; i < args.length; i += 1) {
1486
1489
  const a = args[i];
@@ -1514,6 +1517,12 @@ async function cmdRuntimeSwitch(args = []) {
1514
1517
  settings.bypassPermissions = true;
1515
1518
  }
1516
1519
 
1520
+ const existingPending = readPendingRuntimeSwitch(cwd);
1521
+ if (!explicitModel && !explicitLevel && existingPending?.sessionId === sess.id && existingPending.provider === provider && _modelMatchesProvider(existingPending.model, provider)) {
1522
+ settings.headModel = existingPending.model;
1523
+ if (!explicitEffort && existingPending.effort) settings.effort = existingPending.effort;
1524
+ }
1525
+
1517
1526
  const headPolicy = _headPolicyFor(provider, profile, settings);
1518
1527
  if (!settings.headModel || !_modelMatchesProvider(settings.headModel, provider)) {
1519
1528
  settings.headModel = headPolicy.model;
@@ -1536,6 +1545,7 @@ async function cmdRuntimeSwitch(args = []) {
1536
1545
  effort: settings.effort,
1537
1546
  confirmed,
1538
1547
  reason,
1548
+ changedBy: 'HEAD',
1539
1549
  });
1540
1550
 
1541
1551
  const launchArgs = provider === _sessionTool(sess)
@@ -1546,6 +1556,9 @@ async function cmdRuntimeSwitch(args = []) {
1546
1556
  console.log(`Runtime switch ${confirmed ? 'confirmed' : 'prepared'} for ${pending?.sessionName || sess.id}`);
1547
1557
  console.log(`Provider: ${provider}`);
1548
1558
  console.log(`Mode: ${getEffectiveConversationMode(profile, cwd)}`);
1559
+ console.log(`Model: ${settings.headModel || 'default'}${settings.effort ? ` (${settings.effort})` : ''}`);
1560
+ console.log(`Changed by: HEAD`);
1561
+ console.log(`Reason: ${reason}`);
1549
1562
  console.log(`Launch: ${provider} ${launchArgs.join(' ')}`);
1550
1563
  if (confirmed) {
1551
1564
  const activeForSwitch = readActiveConversation(cwd);
@@ -2714,6 +2727,7 @@ function writePendingRuntimeSwitch(cwd, session, updates = {}) {
2714
2727
  automode: typeof updates.automode === 'boolean' ? updates.automode : null,
2715
2728
  bypassPermissions: typeof updates.bypassPermissions === 'boolean' ? updates.bypassPermissions : null,
2716
2729
  reason: updates.reason || 'runtime-settings-change',
2730
+ changedBy: updates.changedBy || 'HEAD',
2717
2731
  autoLaunch: updates.autoLaunch !== false,
2718
2732
  handoffBrief: updates.handoffBrief || _sessionBrief(session, tool),
2719
2733
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dual-brain",
3
- "version": "0.3.31",
3
+ "version": "0.3.32",
4
4
  "description": "AI orchestration across Claude + OpenAI subscriptions — smart routing, budget awareness, and dual-brain collaboration",
5
5
  "type": "module",
6
6
  "bin": {