openfox 2.0.135 → 2.0.137

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 (87) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/CHANGELOG.md +33 -0
  3. package/dist/agent-defaults/builder.agent.md +1 -0
  4. package/dist/agent-defaults/planner.agent.md +1 -0
  5. package/dist/{ask-UBIRH3SO.js → ask-46J5WYRL.js} +2 -2
  6. package/dist/{auto-config-5VSNLVNI.js → auto-config-2A7Y2WOK.js} +25 -6
  7. package/dist/{backend-NDBY3DAQ.js → backend-24FTDSHF.js} +4 -2
  8. package/dist/{chat-handler-WGDFMOOD.js → chat-handler-ZCPFNHTE.js} +30 -26
  9. package/dist/{chunk-QZOV4OVN.js → chunk-2OO46UAW.js} +5 -5
  10. package/dist/{chunk-7QMWYNVF.js → chunk-4LLGI372.js} +2 -2
  11. package/dist/chunk-4SBVW4UH.js +24 -0
  12. package/dist/{chunk-ZMK4VX7V.js → chunk-64YDOCQR.js} +53 -21
  13. package/dist/{chunk-VHLD6PCZ.js → chunk-6TQNTFJW.js} +17 -11
  14. package/dist/{chunk-UV6IH6HK.js → chunk-AKWJMMEJ.js} +15 -1
  15. package/dist/{chunk-ORCQ3EXQ.js → chunk-BHVR2YS5.js} +2 -2
  16. package/dist/{chunk-S67WIWUG.js → chunk-DG2YSWMC.js} +40 -6
  17. package/dist/chunk-FG4G4EWB.js +7 -0
  18. package/dist/{chunk-NFEZATSN.js → chunk-FIQPKLDY.js} +8 -8
  19. package/dist/chunk-FSSUPWYO.js +336 -0
  20. package/dist/{chunk-5UQ4CKOA.js → chunk-G5GUQKLS.js} +27 -6
  21. package/dist/{chunk-7ET46SNE.js → chunk-HEYU7FAY.js} +3 -3
  22. package/dist/{chunk-4R5GV7RW.js → chunk-JIS6C6PA.js} +21 -21
  23. package/dist/{chunk-5H5NRWHA.js → chunk-LQPAM55V.js} +12 -10
  24. package/dist/{chunk-MEEUXRFL.js → chunk-MMGHIPBU.js} +72 -54
  25. package/dist/{chunk-O3RCSKUH.js → chunk-MOYWDP73.js} +2 -2
  26. package/dist/{chunk-J3NMNYGM.js → chunk-N5JKVNLH.js} +2 -2
  27. package/dist/{chunk-DWA4IE65.js → chunk-Q33DL67W.js} +2 -2
  28. package/dist/{chunk-OZWHRBDY.js → chunk-QBWJCO5K.js} +12 -29
  29. package/dist/{chunk-EUOWCVU6.js → chunk-QMU3ZY2C.js} +37 -341
  30. package/dist/{chunk-CTWZPN7G.js → chunk-QUAEH3MP.js} +29 -1
  31. package/dist/{chunk-BIZFY3QP.js → chunk-RS7I4W5A.js} +212 -148
  32. package/dist/{chunk-5UMXFLET.js → chunk-SAGDTQXD.js} +3 -3
  33. package/dist/{chunk-UKIUQAQZ.js → chunk-U7XCK7WL.js} +4 -4
  34. package/dist/{chunk-JURM3RPZ.js → chunk-V5AC2TV7.js} +8 -13
  35. package/dist/{chunk-JE7LW7Y6.js → chunk-VIJVLLPT.js} +12 -3
  36. package/dist/{chunk-2AI7VYPN.js → chunk-VKMPR25F.js} +9 -3
  37. package/dist/{chunk-IAT2LBIX.js → chunk-WOIQO7ZC.js} +4 -4
  38. package/dist/chunk-WQUCCHOY.js +1155 -0
  39. package/dist/{chunk-F2MOHHXB.js → chunk-X4PVR6AW.js} +2 -2
  40. package/dist/chunk-XG3AUMPI.js +72 -0
  41. package/dist/{chunk-I5ODJKYM.js → chunk-XWWRZSK7.js} +162 -6
  42. package/dist/{chunk-GP3CLMPQ.js → chunk-ZJ2IHOVN.js} +23 -23
  43. package/dist/{chunk-ESZQTFQP.js → chunk-ZQENKB7X.js} +86 -1010
  44. package/dist/cli/dev.js +1 -1
  45. package/dist/cli/index.js +1 -1
  46. package/dist/client-MVI3J7SN.js +18 -0
  47. package/dist/{client-pure-FLKP6PTI.js → client-pure-YZ4IGCU4.js} +4 -2
  48. package/dist/{compactor-454UEIEX.js → compactor-KDTY4ERE.js} +14 -12
  49. package/dist/describe-image-EFHMWGWI.js +30 -0
  50. package/dist/{dynamic-context-LKC6JYLQ.js → dynamic-context-HL4RGNHK.js} +12 -10
  51. package/dist/{events-335XAKFK.js → events-ADE2KEHI.js} +7 -9
  52. package/dist/{export-import-3WMRLO4A.js → export-import-6OUEANYH.js} +7 -7
  53. package/dist/{folding-H7JTX6KI.js → folding-CM63AVSB.js} +6 -6
  54. package/dist/{http-client-A445WYZU.js → http-client-C6UYWVWZ.js} +3 -3
  55. package/dist/launch-L5NSPAAX.js +58 -0
  56. package/dist/{manager-ZACEUL5P.js → manager-FSPRJCYT.js} +4 -4
  57. package/dist/{model-catalog-2PCKTYGW.js → model-catalog-Y5MA5OZP.js} +2 -2
  58. package/dist/{orchestrator-JGJWTRO5.js → orchestrator-FMWKMD54.js} +29 -25
  59. package/dist/package.json +1 -1
  60. package/dist/{path-security-4LROI7F4.js → path-security-DND2R3RP.js} +8 -8
  61. package/dist/{platform-XPMZKAUB.js → platform-KPKYBU54.js} +3 -3
  62. package/dist/{processor-MSQP63ML.js → processor-SB5X44PX.js} +29 -25
  63. package/dist/{provider-JWUNG2TD.js → provider-SOC6Z25R.js} +10 -8
  64. package/dist/{provider-manager-2KKZ37XJ.js → provider-manager-Y53SVVQ3.js} +10 -8
  65. package/dist/{registry-BEIR7Y5G.js → registry-FMDMGIUB.js} +3 -3
  66. package/dist/{serve-CW5C3CBZ.js → serve-VONTGJCK.js} +41 -32
  67. package/dist/server/index.d.ts +1 -0
  68. package/dist/server/index.js +34 -30
  69. package/dist/server-MI2LZK3W.js +61 -0
  70. package/dist/{service-XIUNS5XV.js → service-NKLQH647.js} +12 -9
  71. package/dist/{session-overrides-LYW5PJ3R.js → session-overrides-ANQBKV74.js} +11 -7
  72. package/dist/{sessions-AOK3AGHY.js → sessions-GLYACE5R.js} +4 -4
  73. package/dist/{settings-ZJPM6PQV.js → settings-WH6BVQCP.js} +4 -2
  74. package/dist/{tasks-3JJWJJ3X.js → tasks-GPM3JAE6.js} +14 -10
  75. package/dist/tool-adapter-ZY4FC4C4.js +9 -0
  76. package/dist/{tools-E63MOJBO.js → tools-WLJJ3ILO.js} +27 -23
  77. package/dist/{update-XVXNSSDK.js → update-6ZSQJQJB.js} +2 -2
  78. package/dist/web/assets/{index-wTFCxQAw.js → index-CfFwerN2.js} +84 -84
  79. package/dist/web/assets/{index-Bg_Z8i3F.css → index-ChJjYovg.css} +1 -1
  80. package/dist/web/index.html +2 -2
  81. package/dist/web/sw.js +1 -1
  82. package/package.json +1 -1
  83. package/dist/chunk-WY3PWHWY.js +0 -7
  84. package/dist/client-VVYOWXRR.js +0 -16
  85. package/dist/launch-GJ7EHQRI.js +0 -54
  86. package/dist/server-ZHEB7XS2.js +0 -57
  87. package/dist/tool-adapter-FJAFLDZA.js +0 -8
@@ -1,3 +1,15 @@
1
+ import {
2
+ createWebSocketServer,
3
+ currentSessionToken,
4
+ getAuthConfig,
5
+ hasPassword,
6
+ isValidToken,
7
+ loadServerAuthConfig,
8
+ requiresAuth,
9
+ terminalManager,
10
+ tokenFromPassword,
11
+ verifyPassword
12
+ } from "./chunk-ZJ2IHOVN.js";
1
13
  import {
2
14
  projectSessionStatus
3
15
  } from "./chunk-T3S5MTMD.js";
@@ -13,21 +25,9 @@ import {
13
25
  setMcpOAuthStoreMode,
14
26
  setMcpOAuthStorePath
15
27
  } from "./chunk-IJ53Y77N.js";
16
- import {
17
- createWebSocketServer,
18
- currentSessionToken,
19
- getAuthConfig,
20
- hasPassword,
21
- isValidToken,
22
- loadServerAuthConfig,
23
- requiresAuth,
24
- terminalManager,
25
- tokenFromPassword,
26
- verifyPassword
27
- } from "./chunk-GP3CLMPQ.js";
28
28
  import {
29
29
  TEMPLATE_VARIABLES
30
- } from "./chunk-5H5NRWHA.js";
30
+ } from "./chunk-LQPAM55V.js";
31
31
  import {
32
32
  createToolRegistry,
33
33
  devServerManager,
@@ -42,7 +42,26 @@ import {
42
42
  setMcpManagerForTools,
43
43
  setMcpTools,
44
44
  setNotifyMcpServersChanged
45
- } from "./chunk-ESZQTFQP.js";
45
+ } from "./chunk-ZQENKB7X.js";
46
+ import {
47
+ deleteOwnedSkill,
48
+ deleteProjectSkill,
49
+ deleteSkill,
50
+ findSkillById,
51
+ getDefaultSkillIds,
52
+ isDefaultSkill,
53
+ isSkillEnabled,
54
+ loadAllSkills,
55
+ loadAllSkillsWithDiagnostics,
56
+ loadDefaultSkills,
57
+ loadProjectSkills,
58
+ loadUserSkills,
59
+ saveSkill,
60
+ saveSkillToProject,
61
+ setSkillEnabled,
62
+ skillExists,
63
+ updateOwnedSkill
64
+ } from "./chunk-Q33DL67W.js";
46
65
  import {
47
66
  checkoutBranchFromSharedSource,
48
67
  deleteWorkspace,
@@ -86,49 +105,35 @@ import {
86
105
  saveCommandToProject,
87
106
  saveWorkflow,
88
107
  saveWorkflowToProject,
89
- serverT,
90
108
  workflowExists
91
- } from "./chunk-OZWHRBDY.js";
109
+ } from "./chunk-QBWJCO5K.js";
92
110
  import {
111
+ clearSessionOverrides,
112
+ computeDisabledServersForProject,
93
113
  getSessionDisabledServers,
114
+ initSessionMcpOverrides,
94
115
  setSessionDisabledServers
95
- } from "./chunk-S67WIWUG.js";
116
+ } from "./chunk-DG2YSWMC.js";
96
117
  import {
97
- createMcpTools
98
- } from "./chunk-JE7LW7Y6.js";
99
- import {
100
- deleteOwnedSkill,
101
- deleteProjectSkill,
102
- deleteSkill,
103
- findSkillById,
104
- getDefaultSkillIds,
105
- isDefaultSkill,
106
- isSkillEnabled,
107
- loadAllSkills,
108
- loadAllSkillsWithDiagnostics,
109
- loadDefaultSkills,
110
- loadProjectSkills,
111
- loadUserSkills,
112
- saveSkill,
113
- saveSkillToProject,
114
- setSkillEnabled,
115
- skillExists,
116
- updateOwnedSkill
117
- } from "./chunk-DWA4IE65.js";
118
+ serverT
119
+ } from "./chunk-4SBVW4UH.js";
118
120
  import {
119
121
  ALWAYS_ALLOWED,
120
122
  ALWAYS_ALLOWED_FOR_SUBAGENTS,
121
123
  TOP_LEVEL_ONLY_TOOLS
122
- } from "./chunk-7QMWYNVF.js";
124
+ } from "./chunk-4LLGI372.js";
125
+ import {
126
+ createMcpTools
127
+ } from "./chunk-VIJVLLPT.js";
123
128
  import {
124
129
  EventEmitter,
125
130
  getPendingQuestionsForSession,
126
131
  provideAnswer
127
- } from "./chunk-JURM3RPZ.js";
132
+ } from "./chunk-V5AC2TV7.js";
128
133
  import {
129
134
  getPendingConfirmationsBySession,
130
135
  providePathConfirmation
131
- } from "./chunk-I5ODJKYM.js";
136
+ } from "./chunk-XWWRZSK7.js";
132
137
  import {
133
138
  combineEventsWithSnapshot,
134
139
  emitAssistantMessageStart,
@@ -146,10 +151,10 @@ import {
146
151
  getEventStore,
147
152
  getSessionState,
148
153
  initEventStore
149
- } from "./chunk-QZOV4OVN.js";
154
+ } from "./chunk-2OO46UAW.js";
150
155
  import {
151
156
  buildMessagesFromStoredEvents
152
- } from "./chunk-MEEUXRFL.js";
157
+ } from "./chunk-MMGHIPBU.js";
153
158
  import {
154
159
  clearWorkflowExecution,
155
160
  createSession,
@@ -176,7 +181,7 @@ import {
176
181
  updateSessionRunning,
177
182
  updateSessionWorkdir,
178
183
  updateWorkflowExecutionStatus
179
- } from "./chunk-F2MOHHXB.js";
184
+ } from "./chunk-X4PVR6AW.js";
180
185
  import {
181
186
  agentExists,
182
187
  deleteAgent,
@@ -193,7 +198,7 @@ import {
193
198
  saveAgent,
194
199
  saveAgentToProject,
195
200
  setRuntimeConfig
196
- } from "./chunk-ORCQ3EXQ.js";
201
+ } from "./chunk-BHVR2YS5.js";
197
202
  import {
198
203
  findFileByInternalId,
199
204
  pathExists
@@ -205,19 +210,19 @@ import {
205
210
  import {
206
211
  getPathSeparator,
207
212
  isAbsolutePath
208
- } from "./chunk-O3RCSKUH.js";
213
+ } from "./chunk-MOYWDP73.js";
209
214
  import {
210
215
  createProviderManager,
211
216
  detectModel,
212
217
  getLlmStatus,
213
218
  parseDefaultModelSelection
214
- } from "./chunk-5UQ4CKOA.js";
219
+ } from "./chunk-G5GUQKLS.js";
215
220
  import {
216
221
  buildOpenFoxMcpBootstrap
217
222
  } from "./chunk-YNMP647F.js";
218
223
  import {
219
224
  VERSION
220
- } from "./chunk-WY3PWHWY.js";
225
+ } from "./chunk-FG4G4EWB.js";
221
226
  import {
222
227
  deleteProject,
223
228
  getProject,
@@ -230,25 +235,29 @@ import {
230
235
  import {
231
236
  detectBackendFromUrl,
232
237
  getBackendDisplayName
233
- } from "./chunk-UV6IH6HK.js";
238
+ } from "./chunk-AKWJMMEJ.js";
234
239
  import {
235
240
  buildModelsUrl
236
241
  } from "./chunk-HNCM3D7Y.js";
242
+ import {
243
+ sanitizeToolSchema
244
+ } from "./chunk-XG3AUMPI.js";
237
245
  import {
238
246
  SessionNotFoundError,
239
247
  WorkspaceInUseError
240
- } from "./chunk-J3NMNYGM.js";
248
+ } from "./chunk-N5JKVNLH.js";
241
249
  import {
242
250
  deleteSetting,
243
251
  getSetting,
244
252
  setSetting
245
- } from "./chunk-CTWZPN7G.js";
253
+ } from "./chunk-QUAEH3MP.js";
246
254
  import {
247
255
  initDatabase
248
256
  } from "./chunk-JU757HVI.js";
249
257
  import {
258
+ isReasoningEffortValidForModel,
250
259
  isReasoningEffortValue
251
- } from "./chunk-2AI7VYPN.js";
260
+ } from "./chunk-VKMPR25F.js";
252
261
  import {
253
262
  logger,
254
263
  setLogLevel
@@ -1735,7 +1744,7 @@ var McpManager = class {
1735
1744
  function: {
1736
1745
  name: `${entry.state.name}_${tool.name}`,
1737
1746
  description: tool.description ?? "",
1738
- parameters: tool.inputSchema
1747
+ parameters: sanitizeToolSchema(tool.inputSchema)
1739
1748
  }
1740
1749
  });
1741
1750
  }
@@ -2826,6 +2835,9 @@ var SessionManager = class {
2826
2835
  announcedPromptHashStore = /* @__PURE__ */ new Map();
2827
2836
  announcedToolFingerprintStore = /* @__PURE__ */ new Map();
2828
2837
  warmedUpSessions = /* @__PURE__ */ new Set();
2838
+ // Sessions already warned about an unresolvable provider — getContextState runs on every
2839
+ // turn, and the warning is only worth one line per session.
2840
+ unknownProviderWarned = /* @__PURE__ */ new Set();
2829
2841
  switchLocks = /* @__PURE__ */ new Map();
2830
2842
  workspaceCreationLocks = /* @__PURE__ */ new Map();
2831
2843
  constructor(providerManager) {
@@ -3010,6 +3022,10 @@ var SessionManager = class {
3010
3022
  const contextWindowId = crypto.randomUUID();
3011
3023
  emitSessionInitialized(dbSession.id, projectId, effectiveWorkdir, contextWindowId, sessionTitle);
3012
3024
  const session = this.buildSessionFromDb(dbSession);
3025
+ try {
3026
+ initSessionMcpOverrides(session.id, projectId, project.mcpOverrides);
3027
+ } catch {
3028
+ }
3013
3029
  getGitBranch(effectiveWorkdir).then((branch) => {
3014
3030
  if (branch) {
3015
3031
  updateSessionBranch(session.id, branch);
@@ -3094,6 +3110,10 @@ var SessionManager = class {
3094
3110
  updateSessionCachedPrompt(newSession.id, cached2.systemPrompt, cached2.tools, cached2.hash, cached2.promptHash);
3095
3111
  this.markWarmedUp(newSession.id);
3096
3112
  }
3113
+ const parentDisabledServers = getSessionDisabledServers(originalSessionId);
3114
+ if (parentDisabledServers.length > 0) {
3115
+ setSessionDisabledServers(newSession.id, parentDisabledServers);
3116
+ }
3097
3117
  this.emit({ type: "session_updated", session: this.requireSession(newSession.id) });
3098
3118
  return this.requireSession(newSession.id);
3099
3119
  }
@@ -3112,9 +3132,9 @@ var SessionManager = class {
3112
3132
  * @throws Error for invalid payloads or unknown project
3113
3133
  */
3114
3134
  async importSession(projectId, rawPayload) {
3115
- const { parseSessionExport, IMPORTED_SESSION_REMINDER, SESSION_EXPORT_VERSION } = await import("./export-import-3WMRLO4A.js");
3116
- const { injectContextDriftReminders, getToolSetFingerprint } = await import("./dynamic-context-LKC6JYLQ.js");
3117
- const { loadAllAgentsDefault: loadAllAgentsDefault2, resolveDefaultAgentId } = await import("./registry-BEIR7Y5G.js");
3135
+ const { parseSessionExport, IMPORTED_SESSION_REMINDER, SESSION_EXPORT_VERSION } = await import("./export-import-6OUEANYH.js");
3136
+ const { injectContextDriftReminders, getToolSetFingerprint } = await import("./dynamic-context-HL4RGNHK.js");
3137
+ const { loadAllAgentsDefault: loadAllAgentsDefault2, resolveDefaultAgentId } = await import("./registry-FMDMGIUB.js");
3118
3138
  const payload = parseSessionExport(rawPayload);
3119
3139
  if (payload.version !== SESSION_EXPORT_VERSION) {
3120
3140
  throw new Error(`Unsupported session export version: ${payload.version}`);
@@ -3251,6 +3271,8 @@ var SessionManager = class {
3251
3271
  this.warmedUpSessions.delete(id);
3252
3272
  this.announcedPromptHashStore.delete(id);
3253
3273
  this.announcedToolFingerprintStore.delete(id);
3274
+ this.unknownProviderWarned.delete(id);
3275
+ clearSessionOverrides(id);
3254
3276
  deleteSession(id);
3255
3277
  if (this.activeSessionId === id) {
3256
3278
  this.activeSessionId = null;
@@ -3363,6 +3385,7 @@ var SessionManager = class {
3363
3385
  if (providerId === null || providerManual === true) {
3364
3386
  this.clearSessionPinnedEffort(sessionId);
3365
3387
  }
3388
+ this.unknownProviderWarned.delete(sessionId);
3366
3389
  const updatedSession = this.requireSession(sessionId);
3367
3390
  this.emit({ type: "session_updated", session: updatedSession });
3368
3391
  return updatedSession;
@@ -4029,7 +4052,21 @@ var SessionManager = class {
4029
4052
  getContextState(sessionId) {
4030
4053
  const providerManager = this.providerManager;
4031
4054
  const { providerId, model } = this.resolveEffectiveProviderModel(sessionId);
4032
- const maxTokens = providerId && model ? this.resolveModelContext(providerId, model) ?? providerManager.getCurrentModelContext() : providerManager.getCurrentModelContext();
4055
+ let maxTokens = providerManager.getCurrentModelContext();
4056
+ if (providerId && model) {
4057
+ const resolved = this.resolveModelContext(providerId, model);
4058
+ if (resolved !== void 0) {
4059
+ maxTokens = resolved;
4060
+ } else {
4061
+ if (!this.unknownProviderWarned.has(sessionId)) {
4062
+ this.unknownProviderWarned.add(sessionId);
4063
+ logger.warn("Session references an unknown provider, falling back to the global context window", {
4064
+ sessionId,
4065
+ providerId
4066
+ });
4067
+ }
4068
+ }
4069
+ }
4033
4070
  const state = getSessionState(sessionId, maxTokens);
4034
4071
  const dynamicContextChanged = this.getDynamicContextChanged(sessionId);
4035
4072
  const debugDump = this.debugDumpStore.get(sessionId);
@@ -4391,6 +4428,25 @@ All file and git operations should use this directory.${commitHint}
4391
4428
  }
4392
4429
  };
4393
4430
 
4431
+ // src/server/session/provider-reconcile.ts
4432
+ function clearSessionProviderWhere(isDangling) {
4433
+ let cleared = 0;
4434
+ for (const session of listSessions()) {
4435
+ if (session.providerId && isDangling(session.providerId)) {
4436
+ updateSessionProvider(session.id, null, null);
4437
+ cleared++;
4438
+ }
4439
+ }
4440
+ return cleared;
4441
+ }
4442
+ function clearSessionsForDeletedProvider(providerId) {
4443
+ return clearSessionProviderWhere((pinned) => pinned === providerId);
4444
+ }
4445
+ function reconcileSessionProviders(configuredProviderIds) {
4446
+ const configured = new Set(configuredProviderIds);
4447
+ return clearSessionProviderWhere((pinned) => !configured.has(pinned));
4448
+ }
4449
+
4394
4450
  // src/server/routes/skills.ts
4395
4451
  import { Router as Router2 } from "express";
4396
4452
  import multer from "multer";
@@ -6043,10 +6099,11 @@ function createWorkspaceConfigRoutes(sessionManager) {
6043
6099
  if (mcpOverrides !== void 0) {
6044
6100
  const project = getProjectByWorkdir(workdir);
6045
6101
  if (project) {
6102
+ const overridesObj = Object.keys(mcpOverrides).length > 0 ? mcpOverrides : null;
6046
6103
  updateProject(project.id, {
6047
- mcpOverrides: Object.keys(mcpOverrides).length > 0 ? mcpOverrides : null
6104
+ mcpOverrides: overridesObj
6048
6105
  });
6049
- const disabledServers = Object.entries(mcpOverrides).filter(([, override]) => override.disabled).map(([name]) => name);
6106
+ const disabledServers = computeDisabledServersForProject(overridesObj);
6050
6107
  const allSessions = sessionManager.listSessions();
6051
6108
  for (const s of allSessions) {
6052
6109
  if (s.projectId === project.id) {
@@ -7046,7 +7103,7 @@ function detectWsl() {
7046
7103
  // src/server/index.ts
7047
7104
  var __dirname3 = dirname7(fileURLToPath6(import.meta.url));
7048
7105
  async function announceContextDrift(sessionManager, sessionIds) {
7049
- const { injectContextDriftRemindersForSessions } = await import("./dynamic-context-LKC6JYLQ.js");
7106
+ const { injectContextDriftRemindersForSessions } = await import("./dynamic-context-HL4RGNHK.js");
7050
7107
  await injectContextDriftRemindersForSessions(sessionManager, sessionIds);
7051
7108
  }
7052
7109
  async function createServerHandle(config3) {
@@ -7070,6 +7127,10 @@ async function createServerHandle(config3) {
7070
7127
  }
7071
7128
  config3.providers = providerAdapters.resolveProviders(config3.providers ?? []);
7072
7129
  const providerManager = createProviderManager(config3, { adapters: providerAdapters });
7130
+ const repairedSessions = reconcileSessionProviders(providerManager.getProviders().map((p) => p.id));
7131
+ if (repairedSessions > 0) {
7132
+ logger.warn("Cleared unknown provider from sessions", { sessions: repairedSessions });
7133
+ }
7073
7134
  const sessionManager = new SessionManager(providerManager);
7074
7135
  devServerManager.setSessionManager(sessionManager);
7075
7136
  const useMock = process.env["OPENFOX_MOCK_LLM"] === "true";
@@ -7135,6 +7196,10 @@ async function createServerHandle(config3) {
7135
7196
  }
7136
7197
  });
7137
7198
  setMcpManagerForTools(mcpManager);
7199
+ const { setGlobalMcpServersProvider } = await import("./session-overrides-ANQBKV74.js");
7200
+ setGlobalMcpServersProvider(
7201
+ () => mcpManager.getAllServers().map((s) => ({ name: s.name, disabled: s.config.disabled }))
7202
+ );
7138
7203
  setMcpConfigMode(config3.mode ?? "production");
7139
7204
  setMcpConfigPath(config3.globalConfigPath);
7140
7205
  setMcpOAuthStoreMode(config3.mode ?? "production");
@@ -7153,7 +7218,7 @@ async function createServerHandle(config3) {
7153
7218
  toolRegistry = createToolRegistry();
7154
7219
  logger.info("MCP tools registered", { count: mcpTools.length });
7155
7220
  }
7156
- const { signalMcpReady } = await import("./server-ZHEB7XS2.js");
7221
+ const { signalMcpReady } = await import("./server-MI2LZK3W.js");
7157
7222
  signalMcpReady();
7158
7223
  });
7159
7224
  const app = express();
@@ -7368,9 +7433,9 @@ async function createServerHandle(config3) {
7368
7433
  const sessionFavoriteRouter = express.Router();
7369
7434
  registerSessionFavoriteRoute(sessionFavoriteRouter, sessionManager);
7370
7435
  app.use("/api", sessionFavoriteRouter);
7371
- const { createTasksService } = await import("./service-XIUNS5XV.js");
7372
- const { registerTaskRoutes } = await import("./tasks-3JJWJJ3X.js");
7373
- const { setTasksService } = await import("./tools-E63MOJBO.js");
7436
+ const { createTasksService } = await import("./service-NKLQH647.js");
7437
+ const { registerTaskRoutes } = await import("./tasks-GPM3JAE6.js");
7438
+ const { setTasksService } = await import("./tools-WLJJ3ILO.js");
7374
7439
  const tasksService = createTasksService({
7375
7440
  sessionManager,
7376
7441
  config: config3,
@@ -7402,7 +7467,7 @@ async function createServerHandle(config3) {
7402
7467
  }
7403
7468
  try {
7404
7469
  await checkoutBranch(project.workdir, branch);
7405
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AOK3AGHY.js");
7470
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-GLYACE5R.js");
7406
7471
  const allSessions = sessionManager.listSessions();
7407
7472
  for (const s of allSessions) {
7408
7473
  if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
@@ -7438,7 +7503,7 @@ async function createServerHandle(config3) {
7438
7503
  );
7439
7504
  }
7440
7505
  await createBranch(project.workdir, name, sb);
7441
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AOK3AGHY.js");
7506
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-GLYACE5R.js");
7442
7507
  const allSessions = sessionManager.listSessions();
7443
7508
  for (const s of allSessions) {
7444
7509
  if (sessionManager.getEffectiveWorkdir(s.id) === project.workdir) {
@@ -7470,7 +7535,7 @@ async function createServerHandle(config3) {
7470
7535
  if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
7471
7536
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
7472
7537
  const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-LM646OHC.js");
7473
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AOK3AGHY.js");
7538
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-GLYACE5R.js");
7474
7539
  try {
7475
7540
  await validateRef2(effectiveWorkdir, branch);
7476
7541
  await checkoutBranch(effectiveWorkdir, branch);
@@ -7513,7 +7578,7 @@ All file and git operations should use this branch.
7513
7578
  if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
7514
7579
  const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
7515
7580
  const { validateRef: validateRef2 } = await import("./workspace-LM646OHC.js");
7516
- const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-AOK3AGHY.js");
7581
+ const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-GLYACE5R.js");
7517
7582
  try {
7518
7583
  await validateRef2(effectiveWorkdir, name);
7519
7584
  if (sourceBranch) {
@@ -7568,8 +7633,8 @@ All file and git operations should use this branch.
7568
7633
  res.json({ workspaces: workspacesList });
7569
7634
  });
7570
7635
  app.get("/api/sessions", async (req, res) => {
7571
- const { getRecentUserPromptsForSession } = await import("./events-335XAKFK.js");
7572
- const { getPendingConfirmationsBySession: getPendingConfirmationsBySession2 } = await import("./path-security-4LROI7F4.js");
7636
+ const { getRecentUserPromptsForSession } = await import("./events-ADE2KEHI.js");
7637
+ const { getPendingConfirmationsBySession: getPendingConfirmationsBySession2 } = await import("./path-security-DND2R3RP.js");
7573
7638
  const projectId = req.query["projectId"];
7574
7639
  const rawLimit = req.query["limit"];
7575
7640
  const offset = parseInt(req.query["offset"]) || 0;
@@ -7641,19 +7706,6 @@ All file and git operations should use this branch.
7641
7706
  }
7642
7707
  const { providerId, model } = parseDefaultModelSelection(config3.defaultModelSelection);
7643
7708
  const session = sessionManager.createSession(projectId, title, providerId ?? null, model ?? null);
7644
- try {
7645
- let disabledServers = [];
7646
- if (project.mcpOverrides) {
7647
- disabledServers = Object.entries(project.mcpOverrides).filter(([, override]) => override.disabled).map(([name]) => name);
7648
- } else {
7649
- disabledServers = mcpManager.getAllServers().filter((s) => s.config.disabled).map((s) => s.name);
7650
- }
7651
- if (disabledServers.length > 0) {
7652
- const { setSessionDisabledServers: setSessionDisabledServers2 } = await import("./session-overrides-LYW5PJ3R.js");
7653
- setSessionDisabledServers2(session.id, disabledServers);
7654
- }
7655
- } catch {
7656
- }
7657
7709
  wssExports.broadcastForProject(projectId, session.id, buildSessionCreatedMessage(session));
7658
7710
  res.status(201).json({ session: toClientSession(session) });
7659
7711
  });
@@ -7700,10 +7752,10 @@ All file and git operations should use this branch.
7700
7752
  }
7701
7753
  });
7702
7754
  app.get("/api/sessions/:id", async (req, res) => {
7703
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-335XAKFK.js");
7704
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-H7JTX6KI.js");
7705
- const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-E63MOJBO.js");
7706
- const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
7755
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-ADE2KEHI.js");
7756
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-CM63AVSB.js");
7757
+ const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-WLJJ3ILO.js");
7758
+ const { getMaxVisibleItems } = await import("./settings-WH6BVQCP.js");
7707
7759
  const session = sessionManager.getSession(req.params.id);
7708
7760
  if (!session) {
7709
7761
  return res.status(404).json({ error: "Session not found" });
@@ -7731,9 +7783,9 @@ All file and git operations should use this branch.
7731
7783
  });
7732
7784
  app.get("/api/sessions/:id/status", async (req, res) => {
7733
7785
  const { projectSessionStatus: projectSessionStatus2 } = await import("./session-status-UFO5IFI7.js");
7734
- const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-E63MOJBO.js");
7735
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-335XAKFK.js");
7736
- const { foldPendingConfirmations } = await import("./folding-H7JTX6KI.js");
7786
+ const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-WLJJ3ILO.js");
7787
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEventsWithSnapshot2 } = await import("./events-ADE2KEHI.js");
7788
+ const { foldPendingConfirmations } = await import("./folding-CM63AVSB.js");
7737
7789
  const sessionId = req.params["id"];
7738
7790
  if (!sessionId) {
7739
7791
  return res.status(400).json({ error: "Session id is required" });
@@ -7763,8 +7815,8 @@ All file and git operations should use this branch.
7763
7815
  if (!session) {
7764
7816
  return res.status(404).json({ error: "Session not found" });
7765
7817
  }
7766
- const { stopSessionExecution } = await import("./chat-handler-WGDFMOOD.js");
7767
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-E63MOJBO.js");
7818
+ const { stopSessionExecution } = await import("./chat-handler-ZCPFNHTE.js");
7819
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WLJJ3ILO.js");
7768
7820
  sessionManager.clearMessageQueue(sessionId);
7769
7821
  stopSessionExecution(sessionId, sessionManager);
7770
7822
  abortSession(sessionId);
@@ -7793,9 +7845,9 @@ All file and git operations should use this branch.
7793
7845
  res.json({ success: true });
7794
7846
  });
7795
7847
  app.post("/api/sessions/:id/provider", async (req, res) => {
7796
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-335XAKFK.js");
7797
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
7798
- const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
7848
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-ADE2KEHI.js");
7849
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-CM63AVSB.js");
7850
+ const { getMaxVisibleItems } = await import("./settings-WH6BVQCP.js");
7799
7851
  const sessionId = req.params.id;
7800
7852
  const session = sessionManager.getSession(sessionId);
7801
7853
  if (!session) {
@@ -7805,10 +7857,11 @@ All file and git operations should use this branch.
7805
7857
  if (!providerId) {
7806
7858
  return res.status(400).json({ error: "providerId is required" });
7807
7859
  }
7808
- if (reasoningEffort !== void 0 && reasoningEffort !== null && !isReasoningEffortValue(reasoningEffort)) {
7860
+ const provider = providerManager.getProviders().find((p) => p.id === providerId);
7861
+ const targetModel = provider?.models.find((m) => m.id === model);
7862
+ if (reasoningEffort !== void 0 && reasoningEffort !== null && !isReasoningEffortValidForModel(reasoningEffort, targetModel)) {
7809
7863
  return res.status(400).json({ error: `Unsupported reasoningEffort: ${reasoningEffort}` });
7810
7864
  }
7811
- const provider = providerManager.getProviders().find((p) => p.id === providerId);
7812
7865
  const resolvedModel = model ?? provider?.models?.[0]?.id ?? "auto";
7813
7866
  sessionManager.setSessionProvider(sessionId, providerId, resolvedModel, true, reasoningEffort);
7814
7867
  sessionManager.setSessionProviderActive(sessionId, true);
@@ -7823,9 +7876,9 @@ All file and git operations should use this branch.
7823
7876
  res.json({ session: toClientSession(updatedSession), messages, hiddenCount, contextState });
7824
7877
  });
7825
7878
  app.delete("/api/sessions/:id/provider", async (req, res) => {
7826
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-335XAKFK.js");
7827
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
7828
- const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
7879
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-ADE2KEHI.js");
7880
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-CM63AVSB.js");
7881
+ const { getMaxVisibleItems } = await import("./settings-WH6BVQCP.js");
7829
7882
  const sessionId = req.params.id;
7830
7883
  const session = sessionManager.getSession(sessionId);
7831
7884
  if (!session) {
@@ -7849,7 +7902,9 @@ All file and git operations should use this branch.
7849
7902
  return res.status(404).json({ error: "Session not found" });
7850
7903
  }
7851
7904
  const { effort } = req.body;
7852
- if (!effort || !isReasoningEffortValue(effort)) {
7905
+ const sessionModel = session.providerModel;
7906
+ const targetModel = providerManager.getProviders().flatMap((p) => p.models).find((m) => m.id === sessionModel);
7907
+ if (!effort || !isReasoningEffortValidForModel(effort, targetModel)) {
7853
7908
  return res.status(400).json({ error: `Unsupported reasoningEffort: ${effort}` });
7854
7909
  }
7855
7910
  const updated = sessionManager.setSessionPinnedEffort(sessionId, effort);
@@ -7955,9 +8010,9 @@ All file and git operations should use this branch.
7955
8010
  res.json({ success: true });
7956
8011
  });
7957
8012
  app.put("/api/sessions/:id/mode", async (req, res) => {
7958
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-335XAKFK.js");
7959
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
7960
- const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
8013
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEv } = await import("./events-ADE2KEHI.js");
8014
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-CM63AVSB.js");
8015
+ const { getMaxVisibleItems } = await import("./settings-WH6BVQCP.js");
7961
8016
  const sessionId = req.params.id;
7962
8017
  const session = sessionManager.getSession(sessionId);
7963
8018
  if (!session) {
@@ -8017,7 +8072,7 @@ All file and git operations should use this branch.
8017
8072
  setSessionDisabledServers(sessionId, disabledServers);
8018
8073
  const messages = session.messages ?? [];
8019
8074
  if (messages.length === 0) {
8020
- const { applyDynamicContext } = await import("./dynamic-context-LKC6JYLQ.js");
8075
+ const { applyDynamicContext } = await import("./dynamic-context-HL4RGNHK.js");
8021
8076
  const modelName = session.providerModel ?? providerManager.getCurrentModel();
8022
8077
  await applyDynamicContext(sessionManager, sessionId, modelName);
8023
8078
  } else {
@@ -8051,7 +8106,7 @@ All file and git operations should use this branch.
8051
8106
  if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
8052
8107
  return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
8053
8108
  }
8054
- const { providePathConfirmation: providePathConfirmation2, getConfirmationSessionId } = await import("./tools-E63MOJBO.js");
8109
+ const { providePathConfirmation: providePathConfirmation2, getConfirmationSessionId } = await import("./tools-WLJJ3ILO.js");
8055
8110
  const pendingSessionId = getConfirmationSessionId(callId);
8056
8111
  if (!pendingSessionId) {
8057
8112
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
@@ -8063,11 +8118,11 @@ All file and git operations should use this branch.
8063
8118
  if (!result.found) {
8064
8119
  return res.status(404).json({ error: "No pending path confirmation with that ID" });
8065
8120
  }
8066
- const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-335XAKFK.js");
8067
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-H7JTX6KI.js");
8121
+ const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-ADE2KEHI.js");
8122
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2, foldPendingConfirmations } = await import("./folding-CM63AVSB.js");
8068
8123
  const { createSessionStateMessage } = await import("./protocol-XO4ZROAU.js");
8069
- const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-E63MOJBO.js");
8070
- const { getMaxVisibleItems } = await import("./settings-ZJPM6PQV.js");
8124
+ const { getPendingQuestionsForSession: getPendingQuestionsForSession2 } = await import("./tools-WLJJ3ILO.js");
8125
+ const { getMaxVisibleItems } = await import("./settings-WH6BVQCP.js");
8071
8126
  const eventStore = getEventStore2();
8072
8127
  const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
8073
8128
  const events = combineEvents(sessionId, snapshot, eventsSinceSnapshot);
@@ -8104,7 +8159,7 @@ All file and git operations should use this branch.
8104
8159
  if (!skip && typeof answer !== "string") {
8105
8160
  return res.status(400).json({ error: "answer is required when not skipping" });
8106
8161
  }
8107
- const { provideAnswer: provideAnswer2 } = await import("./tools-E63MOJBO.js");
8162
+ const { provideAnswer: provideAnswer2 } = await import("./tools-WLJJ3ILO.js");
8108
8163
  const found = provideAnswer2(callId, answer ?? "", skip ?? false);
8109
8164
  if (!found) {
8110
8165
  return res.status(404).json({ error: "No pending question with that ID" });
@@ -8137,7 +8192,7 @@ All file and git operations should use this branch.
8137
8192
  if (!session) {
8138
8193
  return res.status(404).json({ error: "Session not found" });
8139
8194
  }
8140
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-ZJPM6PQV.js");
8195
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-WH6BVQCP.js");
8141
8196
  if (getSetting2(SETTINGS_KEYS.CACHE_WARMING) !== "true") {
8142
8197
  return res.json({ success: false, reason: "disabled" });
8143
8198
  }
@@ -8170,7 +8225,7 @@ All file and git operations should use this branch.
8170
8225
  backend: activeProvider?.backend ?? llmClient.getBackend(),
8171
8226
  model: llmClient.getModel()
8172
8227
  };
8173
- const { runAgentTurn, TurnMetrics } = await import("./orchestrator-JGJWTRO5.js");
8228
+ const { runAgentTurn, TurnMetrics } = await import("./orchestrator-FMWKMD54.js");
8174
8229
  runAgentTurn(
8175
8230
  {
8176
8231
  sessionManager,
@@ -8208,15 +8263,15 @@ All file and git operations should use this branch.
8208
8263
  if (!session) {
8209
8264
  return res.status(404).json({ error: "Session not found" });
8210
8265
  }
8211
- const { stopSessionExecution } = await import("./chat-handler-WGDFMOOD.js");
8212
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-E63MOJBO.js");
8266
+ const { stopSessionExecution } = await import("./chat-handler-ZCPFNHTE.js");
8267
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WLJJ3ILO.js");
8213
8268
  const queuedMessages = sessionManager.getQueueState(sessionId);
8214
8269
  sessionManager.clearMessageQueue(sessionId);
8215
8270
  stopSessionExecution(sessionId, sessionManager);
8216
8271
  abortSession(sessionId);
8217
8272
  cancelQuestionsForSession(sessionId, "Session stopped by user");
8218
8273
  cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
8219
- const eventStore = (await import("./events-335XAKFK.js")).getEventStore();
8274
+ const eventStore = (await import("./events-ADE2KEHI.js")).getEventStore();
8220
8275
  eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
8221
8276
  res.json({ success: true, queuedMessages });
8222
8277
  });
@@ -8230,7 +8285,7 @@ All file and git operations should use this branch.
8230
8285
  if (typeof messageIndex !== "number" || messageIndex < 0) {
8231
8286
  return res.status(400).json({ error: "messageIndex must be a non-negative number" });
8232
8287
  }
8233
- const { truncateSessionMessages } = await import("./events-335XAKFK.js");
8288
+ const { truncateSessionMessages } = await import("./events-ADE2KEHI.js");
8234
8289
  truncateSessionMessages(sessionId, messageIndex);
8235
8290
  res.json({ success: true });
8236
8291
  });
@@ -8250,8 +8305,8 @@ All file and git operations should use this branch.
8250
8305
  if (attachments !== void 0 && !Array.isArray(attachments)) {
8251
8306
  return res.status(400).json({ error: "attachments must be an array if provided" });
8252
8307
  }
8253
- const { getEventStore: getEventStore2 } = await import("./events-335XAKFK.js");
8254
- const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-H7JTX6KI.js");
8308
+ const { getEventStore: getEventStore2 } = await import("./events-ADE2KEHI.js");
8309
+ const { buildMessagesFromStoredEvents: buildMessagesFromStoredEvents2 } = await import("./folding-CM63AVSB.js");
8255
8310
  const eventStore = getEventStore2();
8256
8311
  const events = eventStore.getEvents(sessionId);
8257
8312
  const { messages } = buildMessagesFromStoredEvents2(events);
@@ -8263,7 +8318,7 @@ All file and git operations should use this branch.
8263
8318
  if (msg.role !== "user" || msg.isSystemGenerated) {
8264
8319
  return res.status(400).json({ error: "Can only replay user messages" });
8265
8320
  }
8266
- const { truncateSessionMessages } = await import("./events-335XAKFK.js");
8321
+ const { truncateSessionMessages } = await import("./events-ADE2KEHI.js");
8267
8322
  truncateSessionMessages(sessionId, msgIndex - 1);
8268
8323
  sessionManager.queueMessage(
8269
8324
  sessionId,
@@ -8305,7 +8360,7 @@ All file and git operations should use this branch.
8305
8360
  return res.status(404).json({ error: "Session not found" });
8306
8361
  }
8307
8362
  try {
8308
- const { buildSessionExport } = await import("./export-import-3WMRLO4A.js");
8363
+ const { buildSessionExport } = await import("./export-import-6OUEANYH.js");
8309
8364
  const payload = buildSessionExport(sessionManager, sessionId);
8310
8365
  const filename = `${(payload.session.title ?? "session").replace(/[^a-zA-Z0-9-_]/g, "_")}.openfox-session.json`;
8311
8366
  res.setHeader("Content-Disposition", `attachment; filename="${filename}"`);
@@ -8362,7 +8417,7 @@ All file and git operations should use this branch.
8362
8417
  res.json({ accepted: true });
8363
8418
  });
8364
8419
  app.get("/api/settings", async (req, res) => {
8365
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-ZJPM6PQV.js");
8420
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-WH6BVQCP.js");
8366
8421
  const keysParam = req.query["keys"];
8367
8422
  if (!keysParam) {
8368
8423
  return res.status(400).json({ error: "keys query parameter is required" });
@@ -8375,19 +8430,19 @@ All file and git operations should use this branch.
8375
8430
  res.json(result);
8376
8431
  });
8377
8432
  app.get("/api/settings/:key", async (req, res) => {
8378
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-ZJPM6PQV.js");
8433
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-WH6BVQCP.js");
8379
8434
  const key = req.params.key;
8380
8435
  const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
8381
8436
  res.json({ key, value });
8382
8437
  });
8383
8438
  app.get("/api/settings/:key", async (req, res) => {
8384
- const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-ZJPM6PQV.js");
8439
+ const { getSetting: getSetting2, SETTINGS_DEFAULTS } = await import("./settings-WH6BVQCP.js");
8385
8440
  const key = req.params.key;
8386
8441
  const value = getSetting2(key) ?? SETTINGS_DEFAULTS[key] ?? null;
8387
8442
  res.json({ key, value });
8388
8443
  });
8389
8444
  app.put("/api/settings/:key", async (req, res) => {
8390
- const { setSetting: setSetting2 } = await import("./settings-ZJPM6PQV.js");
8445
+ const { setSetting: setSetting2 } = await import("./settings-WH6BVQCP.js");
8391
8446
  const key = req.params.key;
8392
8447
  const { value } = req.body;
8393
8448
  if (value === void 0) {
@@ -8414,7 +8469,7 @@ All file and git operations should use this branch.
8414
8469
  }
8415
8470
  });
8416
8471
  app.get("/api/tools/shells", async (_req, res) => {
8417
- const { listAvailableShells } = await import("./platform-XPMZKAUB.js");
8472
+ const { listAvailableShells } = await import("./platform-KPKYBU54.js");
8418
8473
  res.json({ shells: listAvailableShells() });
8419
8474
  });
8420
8475
  app.get("/api/config", async (_req, res) => {
@@ -8452,7 +8507,7 @@ All file and git operations should use this branch.
8452
8507
  defaultModelSelection: config3.defaultModelSelection,
8453
8508
  visionFallback,
8454
8509
  platform: platformInfo,
8455
- locale: (await import("./settings-ZJPM6PQV.js")).getSetting("display.locale") ?? "automatic"
8510
+ locale: (await import("./settings-WH6BVQCP.js")).getSetting("display.locale") ?? "automatic"
8456
8511
  });
8457
8512
  });
8458
8513
  app.post("/api/model/refresh", async (_req, res) => {
@@ -8508,7 +8563,7 @@ All file and git operations should use this branch.
8508
8563
  }));
8509
8564
  }
8510
8565
  app.post("/api/proxy/test", async (_req, res) => {
8511
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-ZJPM6PQV.js");
8566
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-WH6BVQCP.js");
8512
8567
  const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
8513
8568
  if (!proxyUrl) {
8514
8569
  return res.status(400).json({ success: false, error: "No proxy URL configured" });
@@ -8600,7 +8655,7 @@ All file and git operations should use this branch.
8600
8655
  }
8601
8656
  });
8602
8657
  app.post("/api/proxy/test", async (_req, res) => {
8603
- const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-ZJPM6PQV.js");
8658
+ const { getSetting: getSetting2, SETTINGS_KEYS } = await import("./settings-WH6BVQCP.js");
8604
8659
  const proxyUrl = getSetting2(SETTINGS_KEYS.PROXY_URL);
8605
8660
  if (!proxyUrl) {
8606
8661
  return res.status(400).json({ success: false, error: "No proxy URL configured" });
@@ -8627,9 +8682,9 @@ All file and git operations should use this branch.
8627
8682
  const backend = req.query["backend"];
8628
8683
  if (!url) return res.status(400).json({ error: "url is required" });
8629
8684
  try {
8630
- const { fetchModelsWithContext } = await import("./provider-manager-2KKZ37XJ.js");
8685
+ const { fetchModelsWithContext } = await import("./provider-manager-Y53SVVQ3.js");
8631
8686
  const { getModelProfile: getModelProfile2 } = await import("./profiles-EBCVFYG7.js");
8632
- const { getCatalogEntry } = await import("./model-catalog-2PCKTYGW.js");
8687
+ const { getCatalogEntry } = await import("./model-catalog-Y5MA5OZP.js");
8633
8688
  const models = await fetchModelsWithContext(
8634
8689
  url,
8635
8690
  apiKey,
@@ -8667,7 +8722,7 @@ All file and git operations should use this branch.
8667
8722
  if (!url) return res.status(400).json({ error: "url is required" });
8668
8723
  if (!models?.length) return res.status(400).json({ error: "models is required" });
8669
8724
  try {
8670
- const { autoConfig } = await import("./auto-config-5VSNLVNI.js");
8725
+ const { autoConfig } = await import("./auto-config-2A7Y2WOK.js");
8671
8726
  const result = await autoConfig({
8672
8727
  url,
8673
8728
  ...apiKey ? { apiKey } : {},
@@ -8700,9 +8755,9 @@ All file and git operations should use this branch.
8700
8755
  return res.json({ success: true, message: { content: response2.content }, raw: response2 });
8701
8756
  }
8702
8757
  const { getModelProfile: getModelProfile2 } = await import("./profiles-EBCVFYG7.js");
8703
- const { getBackendCapabilities } = await import("./backend-NDBY3DAQ.js");
8704
- const { buildNonStreamingCreateParams } = await import("./client-pure-FLKP6PTI.js");
8705
- const { OpenAIHttpClient } = await import("./http-client-A445WYZU.js");
8758
+ const { getBackendCapabilities } = await import("./backend-24FTDSHF.js");
8759
+ const { buildNonStreamingCreateParams } = await import("./client-pure-YZ4IGCU4.js");
8760
+ const { OpenAIHttpClient } = await import("./http-client-C6UYWVWZ.js");
8706
8761
  const { ensureVersionPrefix } = await import("./url-utils-C5BM7NF7.js");
8707
8762
  const profile = getModelProfile2(model);
8708
8763
  const capabilities = getBackendCapabilities(backend || "unknown");
@@ -8975,6 +9030,12 @@ All file and git operations should use this branch.
8975
9030
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
8976
9031
  providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
8977
9032
  config3.defaultModelSelection = updatedConfig.defaultModelSelection;
9033
+ const clearedSessions = clearSessionsForDeletedProvider(id);
9034
+ if (clearedSessions > 0) {
9035
+ logger.info("Cleared provider from sessions of deleted provider", { providerId: id, sessions: clearedSessions });
9036
+ }
9037
+ const { pruneFavoriteModels } = await import("./settings-WH6BVQCP.js");
9038
+ pruneFavoriteModels(updatedConfig.providers);
8978
9039
  res.json({ success: true });
8979
9040
  });
8980
9041
  app.patch("/api/providers/:id", async (req, res) => {
@@ -9036,6 +9097,8 @@ All file and git operations should use this branch.
9036
9097
  await saveGlobalConfig(config3.mode ?? "production", updatedConfig, config3.globalConfigPath);
9037
9098
  providerManager.setProviders(updatedConfig.providers, updatedConfig.defaultModelSelection ?? void 0);
9038
9099
  config3.defaultModelSelection = updatedConfig.defaultModelSelection;
9100
+ const { pruneFavoriteModels } = await import("./settings-WH6BVQCP.js");
9101
+ pruneFavoriteModels(updatedConfig.providers);
9039
9102
  res.json({ success: true, provider: updatedConfig.providers.find((p) => p.id === id) });
9040
9103
  } catch (error) {
9041
9104
  res.status(500).json({ error: error instanceof Error ? error.message : "Failed to update provider" });
@@ -9049,9 +9112,6 @@ All file and git operations should use this branch.
9049
9112
  app.put("/api/providers/:id/models/:modelId/settings", async (req, res) => {
9050
9113
  const { id, modelId } = req.params;
9051
9114
  const { thinkingLevel, thinkingEnabled } = req.body;
9052
- if (thinkingLevel !== void 0 && !isReasoningEffortValue(thinkingLevel)) {
9053
- return res.status(400).json({ error: `Invalid reasoning effort '${thinkingLevel}'` });
9054
- }
9055
9115
  if (thinkingEnabled !== void 0 && typeof thinkingEnabled !== "boolean") {
9056
9116
  return res.status(400).json({ error: "thinkingEnabled must be a boolean" });
9057
9117
  }
@@ -9063,9 +9123,13 @@ All file and git operations should use this branch.
9063
9123
  return res.status(404).json({ error: "Provider not found" });
9064
9124
  }
9065
9125
  const models = provider.models ?? [];
9066
- if (!models.some((m) => m.id === modelId)) {
9126
+ const targetModel = models.find((m) => m.id === modelId);
9127
+ if (!targetModel) {
9067
9128
  return res.status(404).json({ error: "Model not found" });
9068
9129
  }
9130
+ if (thinkingLevel !== void 0 && !isReasoningEffortValidForModel(thinkingLevel, targetModel)) {
9131
+ return res.status(400).json({ error: `Invalid reasoning effort '${thinkingLevel}'` });
9132
+ }
9069
9133
  const updatedModels = models.map(
9070
9134
  (m) => m.id === modelId ? {
9071
9135
  ...m,
@@ -9118,8 +9182,8 @@ All file and git operations should use this branch.
9118
9182
  });
9119
9183
  });
9120
9184
  async function rebuildMcpTools() {
9121
- const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-FJAFLDZA.js");
9122
- const { setMcpTools: setMcpTools2 } = await import("./tools-E63MOJBO.js");
9185
+ const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-ZY4FC4C4.js");
9186
+ const { setMcpTools: setMcpTools2 } = await import("./tools-WLJJ3ILO.js");
9123
9187
  const mcpTools = createMcpTools2(mcpManager);
9124
9188
  setMcpTools2(mcpTools);
9125
9189
  toolRegistry = createToolRegistry();
@@ -9549,13 +9613,13 @@ All file and git operations should use this branch.
9549
9613
  })
9550
9614
  );
9551
9615
  app.get("/api/sessions/:id/background-processes", async (req, res) => {
9552
- const { getSessionProcesses } = await import("./manager-ZACEUL5P.js");
9616
+ const { getSessionProcesses } = await import("./manager-FSPRJCYT.js");
9553
9617
  const sessionId = req.params.id;
9554
9618
  const processes = getSessionProcesses(sessionId);
9555
9619
  res.json({ processes });
9556
9620
  });
9557
9621
  app.post("/api/sessions/:id/background-process/:processId/stop", async (req, res) => {
9558
- const { stopProcess } = await import("./manager-ZACEUL5P.js");
9622
+ const { stopProcess } = await import("./manager-FSPRJCYT.js");
9559
9623
  const sessionId = req.params.id;
9560
9624
  const processId = req.params.processId;
9561
9625
  const session = sessionManager.getSession(sessionId);
@@ -9695,7 +9759,7 @@ All file and git operations should use this branch.
9695
9759
  );
9696
9760
  const wss = wssExports.wss;
9697
9761
  deferTasksBroadcast = (projectId, payload) => wssExports.broadcastForProject(projectId, "", { type: "tasks.update", payload });
9698
- const { launchWorkflowRun, abortRunnerRun } = await import("./launch-GJ7EHQRI.js");
9762
+ const { launchWorkflowRun, abortRunnerRun } = await import("./launch-L5NSPAAX.js");
9699
9763
  deferTasksLaunchWorkflow = (sessionId, launch) => {
9700
9764
  const effective = sessionManager.resolveEffectiveProviderModel(sessionId);
9701
9765
  let llmClient = getLLMClient();
@@ -9740,7 +9804,7 @@ All file and git operations should use this branch.
9740
9804
  const state = sessionManager.getContextState(sessionId);
9741
9805
  wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
9742
9806
  });
9743
- const { QueueProcessor } = await import("./processor-MSQP63ML.js");
9807
+ const { QueueProcessor } = await import("./processor-SB5X44PX.js");
9744
9808
  const queueProcessor = new QueueProcessor({
9745
9809
  sessionManager,
9746
9810
  providerManager,
@@ -9782,8 +9846,8 @@ All file and git operations should use this branch.
9782
9846
  launchWorkflow: (sessionId, launch) => deferTasksLaunchWorkflow(sessionId, launch),
9783
9847
  stopSession: (sessionId) => {
9784
9848
  void (async () => {
9785
- const { stopSessionExecution } = await import("./chat-handler-WGDFMOOD.js");
9786
- const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-E63MOJBO.js");
9849
+ const { stopSessionExecution } = await import("./chat-handler-ZCPFNHTE.js");
9850
+ const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-WLJJ3ILO.js");
9787
9851
  sessionManager.clearMessageQueue(sessionId);
9788
9852
  stopSessionExecution(sessionId, sessionManager);
9789
9853
  abortSession(sessionId);
@@ -9904,4 +9968,4 @@ export {
9904
9968
  createServerHandle,
9905
9969
  createServer
9906
9970
  };
9907
- //# sourceMappingURL=chunk-BIZFY3QP.js.map
9971
+ //# sourceMappingURL=chunk-RS7I4W5A.js.map