pikiclaw 0.3.22 → 0.3.24

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.
@@ -937,7 +937,7 @@ function getClaudeSessionMessages(opts) {
937
937
  // Models
938
938
  // ---------------------------------------------------------------------------
939
939
  const CLAUDE_MODELS = [
940
- { id: 'claude-opus-4-6', alias: 'opus' },
940
+ { id: 'claude-opus-4-7', alias: 'opus' },
941
941
  { id: 'claude-sonnet-4-6', alias: 'sonnet' },
942
942
  { id: 'claude-haiku-4-5-20251001', alias: 'haiku' },
943
943
  ];
package/dist/bot/bot.js CHANGED
@@ -6,7 +6,7 @@
6
6
  import os from 'node:os';
7
7
  import path from 'node:path';
8
8
  import { execSync, spawn } from 'node:child_process';
9
- import { getActiveUserConfig, onUserConfigChange, resolveUserWorkdir, setUserWorkdir } from '../core/config/user-config.js';
9
+ import { getActiveUserConfig, onUserConfigChange, resolveUserWorkdir, setUserWorkdir, updateUserConfig } from '../core/config/user-config.js';
10
10
  import { doStream, ensureManagedSession, findManagedThreadSession, findThreadSessionAcrossAgents, getSessionStoredConfig, getUsage, initializeProjectSkills, listAgents, listModels, listSkills, stageSessionFiles, isPendingSessionId, } from '../agent/index.js';
11
11
  import { querySessions, querySessionTail, updateSession, } from './session-hub.js';
12
12
  import { getDriver, hasDriver, allDriverIds } from '../agent/driver.js';
@@ -1185,11 +1185,16 @@ export class Bot {
1185
1185
  const cs = this.chat(chatId);
1186
1186
  this.setModelForAgent(cs.agent, modelId);
1187
1187
  this.resetChatConversation(cs);
1188
+ this.persistAgentPreference(cs.agent, 'model', modelId);
1188
1189
  this.log(`model switched to ${modelId} for ${cs.agent} chat=${chatId}`);
1189
1190
  }
1190
1191
  switchEffortForChat(chatId, effort) {
1191
1192
  const cs = this.chat(chatId);
1192
1193
  this.setEffortForAgent(cs.agent, effort);
1194
+ const session = this.getSelectedSession(cs);
1195
+ if (session)
1196
+ session.thinkingEffort = effort;
1197
+ this.persistAgentPreference(cs.agent, 'effort', effort);
1193
1198
  this.log(`effort switched to ${effort} for ${cs.agent} chat=${chatId}`);
1194
1199
  }
1195
1200
  switchPermissionModeForChat(chatId, mode) {
@@ -1250,6 +1255,30 @@ export class Bot {
1250
1255
  config.reasoningEffort = effort;
1251
1256
  this.log(`effort for ${agent} changed to ${effort}`);
1252
1257
  }
1258
+ persistAgentPreference(agent, kind, value) {
1259
+ try {
1260
+ const patch = {};
1261
+ if (kind === 'model') {
1262
+ if (agent === 'claude')
1263
+ patch.claudeModel = value;
1264
+ else if (agent === 'codex')
1265
+ patch.codexModel = value;
1266
+ else if (agent === 'gemini')
1267
+ patch.geminiModel = value;
1268
+ }
1269
+ else {
1270
+ if (agent === 'claude')
1271
+ patch.claudeReasoningEffort = value;
1272
+ else if (agent === 'codex')
1273
+ patch.codexReasoningEffort = value;
1274
+ }
1275
+ if (Object.keys(patch).length)
1276
+ updateUserConfig(patch);
1277
+ }
1278
+ catch (e) {
1279
+ this.warn(`persistAgentPreference failed: ${e?.message || e}`);
1280
+ }
1281
+ }
1253
1282
  getStatusData(chatId) {
1254
1283
  const cs = this.chat(chatId);
1255
1284
  const selectedSession = this.getSelectedSession(cs);
@@ -163,7 +163,7 @@ export function getSkillsListData(bot, chatId) {
163
163
  .filter((skill) => !!skill);
164
164
  return { agent: cs.agent, workdir: bot.chatWorkdir(chatId), skills };
165
165
  }
166
- function claudeModelSelectionKey(modelId) {
166
+ function claudeModelFamily(modelId) {
167
167
  const value = normalizeClaudeModelId(modelId).toLowerCase();
168
168
  if (!value)
169
169
  return null;
@@ -175,13 +175,19 @@ function claudeModelSelectionKey(modelId) {
175
175
  return 'haiku';
176
176
  return null;
177
177
  }
178
+ function isClaudeFamilyAlias(modelId) {
179
+ const v = modelId.trim().toLowerCase();
180
+ return v === 'opus' || v === 'sonnet' || v === 'haiku';
181
+ }
178
182
  export function modelMatchesSelection(agent, selection, currentModel) {
179
183
  if (selection === currentModel)
180
184
  return true;
181
185
  if (agent !== 'claude')
182
186
  return false;
183
- const a = claudeModelSelectionKey(selection);
184
- const b = claudeModelSelectionKey(currentModel);
187
+ if (!isClaudeFamilyAlias(selection) && !isClaudeFamilyAlias(currentModel))
188
+ return false;
189
+ const a = claudeModelFamily(selection);
190
+ const b = claudeModelFamily(currentModel);
185
191
  return !!a && a === b;
186
192
  }
187
193
  const EFFORT_LEVELS = {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { normalizeClaudeModelId } from '../../agent/index.js';
5
5
  export const DEFAULT_AGENT_MODELS = {
6
- claude: 'claude-opus-4-6',
6
+ claude: 'claude-opus-4-7',
7
7
  codex: 'gpt-5.4',
8
8
  gemini: 'gemini-3.1-pro-preview',
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pikiclaw",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "Put the world's smartest AI agents in your pocket. Command local Claude & Gemini via IM. | 让最好用的 IM 变成你电脑上的顶级 Agent 控制台",
5
5
  "type": "module",
6
6
  "bin": {