openfox 2.0.101 → 2.0.103

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 (68) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/CHANGELOG.md +25 -0
  3. package/dist/{chat-handler-YPWT4MAQ.js → chat-handler-IBFSBSGV.js} +22 -21
  4. package/dist/{chunk-O2PLNJIU.js → chunk-2EYTYXWN.js} +2 -2
  5. package/dist/{chunk-MRWR3SIT.js → chunk-4Z2ARCY3.js} +2 -2
  6. package/dist/{chunk-AY37NB76.js → chunk-5ZJYEINJ.js} +2 -2
  7. package/dist/{chunk-XTKLA4AK.js → chunk-73EV6QYX.js} +4 -4
  8. package/dist/{chunk-XLI6PDJG.js → chunk-7HIJP4PC.js} +2 -2
  9. package/dist/{chunk-W77HIJGH.js → chunk-AI27N57J.js} +3 -3
  10. package/dist/{chunk-VJILJ22N.js → chunk-BJDQPILB.js} +3 -3
  11. package/dist/{chunk-MO3GJIT3.js → chunk-DPRJYQ5U.js} +132 -43
  12. package/dist/{chunk-3LRYZ7R3.js → chunk-FQS7A5M4.js} +2 -2
  13. package/dist/{chunk-NWO6GRYE.js → chunk-JE7LW7Y6.js} +2 -1
  14. package/dist/{chunk-MBYXZ5V5.js → chunk-JL657X72.js} +5 -5
  15. package/dist/{chunk-C6QW2IDH.js → chunk-K6VVTE6C.js} +30 -28
  16. package/dist/{chunk-UIK6GA3P.js → chunk-KCED2X4H.js} +2 -2
  17. package/dist/{chunk-NLN5LPQ4.js → chunk-KKEBXFB3.js} +2 -2
  18. package/dist/{chunk-HAFRPV7I.js → chunk-KLK5N4OX.js} +3 -3
  19. package/dist/{chunk-KQPDU65K.js → chunk-MGKS2NG2.js} +3 -3
  20. package/dist/{chunk-TDHDLDGQ.js → chunk-MR7ZEGOF.js} +2 -2
  21. package/dist/{chunk-CFTT46KH.js → chunk-QL2G5UWE.js} +26 -24
  22. package/dist/{chunk-7GBFQ2PE.js → chunk-REQIAJTV.js} +245 -111
  23. package/dist/{chunk-ZIMGU5ZH.js → chunk-RZC6DAT2.js} +2 -2
  24. package/dist/chunk-SQYMFWY7.js +7 -0
  25. package/dist/chunk-W5FTCTGY.js +72 -0
  26. package/dist/{chunk-E2CSSHSI.js → chunk-W5RC44R6.js} +10 -10
  27. package/dist/{chunk-KNYPBXPW.js → chunk-WPCYFH6X.js} +4 -4
  28. package/dist/{chunk-UEOEA6BB.js → chunk-YZSBJUGC.js} +3 -2
  29. package/dist/{chunk-IXFEXEUL.js → chunk-Z753S3X7.js} +6 -6
  30. package/dist/{chunk-G5JFKTSR.js → chunk-ZLCPNTRT.js} +4 -4
  31. package/dist/cli/dev.js +1 -1
  32. package/dist/cli/index.js +1 -1
  33. package/dist/{client-CFTJH6BY.js → client-Q7BHKOCD.js} +5 -5
  34. package/dist/{client-pure-DCEZBFKW.js → client-pure-ONSVWEG5.js} +2 -2
  35. package/dist/{compactor-B4V75Q3A.js → compactor-43P3LGDU.js} +11 -11
  36. package/dist/{dynamic-context-MA5BIJ52.js → dynamic-context-AMPVZXUU.js} +7 -7
  37. package/dist/{events-4THEZWVL.js → events-RCC32JOA.js} +6 -6
  38. package/dist/{folding-OYBO2NTH.js → folding-ZNUXPQUD.js} +4 -4
  39. package/dist/{http-client-U6DVFL7F.js → http-client-WGNBG7PC.js} +3 -3
  40. package/dist/{manager-53J5P4EZ.js → manager-HFGJLW7Q.js} +4 -4
  41. package/dist/model-overrides-DQDT5Y7R.js +21 -0
  42. package/dist/{orchestrator-DHBU7LRB.js → orchestrator-QDXKDLOW.js} +26 -25
  43. package/dist/package.json +1 -1
  44. package/dist/{path-security-6GYETPWN.js → path-security-SUFEIBTC.js} +7 -7
  45. package/dist/{platform-7KXP3VVA.js → platform-2RLL7RAE.js} +3 -3
  46. package/dist/{processor-RC3IBY2J.js → processor-YWNLWAZW.js} +21 -20
  47. package/dist/{provider-PEJ27FBM.js → provider-FX3QCGAF.js} +6 -6
  48. package/dist/{provider-manager-EJGPSLOZ.js → provider-manager-GLG6BA32.js} +6 -6
  49. package/dist/{registry-QEOTM3IG.js → registry-GBNLVWYQ.js} +3 -3
  50. package/dist/{serve-KM2RVX2U.js → serve-FE4UAXGE.js} +27 -26
  51. package/dist/server/index.d.ts +15 -0
  52. package/dist/server/index.js +26 -25
  53. package/dist/server-QGQGSHW6.js +47 -0
  54. package/dist/{service-2PW2V25M.js → service-CXWJQFOZ.js} +62 -20
  55. package/dist/{session-overrides-BQSE3V3F.js → session-overrides-MBGBX6TM.js} +5 -5
  56. package/dist/{sessions-AUDWMF55.js → sessions-FEIFYGH7.js} +4 -4
  57. package/dist/{settings-2WVGUPYV.js → settings-FT7HF7ZB.js} +2 -2
  58. package/dist/skill-defaults/browser/SKILL.md +8 -1
  59. package/dist/{tool-adapter-MOGEI6TP.js → tool-adapter-FEAHWU5C.js} +2 -2
  60. package/dist/{tools-X5FONL4Q.js → tools-M5DKWCJJ.js} +19 -16
  61. package/dist/{update-GHS75L7T.js → update-KMPQUPQT.js} +2 -2
  62. package/dist/web/assets/{index-BG5sD2ez.css → index-B0CNNl1k.css} +1 -1
  63. package/dist/web/assets/{index-CCBacuE6.js → index-FWViKQkM.js} +83 -83
  64. package/dist/web/index.html +2 -2
  65. package/dist/web/sw.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/chunk-UCNMVJXD.js +0 -7
  68. package/dist/server-ORYMG5HD.js +0 -46
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.103 - 2026-07-30
4
+
5
+ ### Bug Fixes
6
+
7
+ - **LSP server crashes no longer freeze write_file/edit_file** — rapid process deaths during startup (e.g., rust-analyzer missing on macOS) are now caught early, letting the tool complete normally.
8
+ - **Hung LSP servers time out after 5 seconds** — the initialize handshake now has a timeout, preventing a non-responsive server from blocking the agent loop.
9
+
10
+ ## 2.0.102 - 2026-07-29
11
+
12
+ ### Features
13
+
14
+ - **Assign any agent a specific model override** — each agent can now be assigned a provider+model that kicks in when that agent is selected, overriding the session or global model.
15
+ - **Control MCP tool access per agent** — choose All, None, or pick individual MCP tools for each agent with a three-state permission selector.
16
+
17
+ ### Enhancements
18
+
19
+ - **Browser skill updated to @playwright/cli v1.1.0** — the browser-control skill now references the official Playwright CLI package.
20
+
21
+ ### Bug Fixes
22
+
23
+ - **Workflow step_done nudge fires on every iteration after resume** — when a resumed workflow loops back, the step_done reminder is now injected on every subsequent turn, not just the first.
24
+ - **Systemd service works in headless/SSH environments** — dropped the dependency on `graphical-session.target` so the service installs and runs without a desktop session. Auto-detects headless mode, with `--headless`/`--desktop` flags for explicit control.
25
+ - **Project agents appear in the mode switcher dropdown** — project-scoped custom agents are now listed alongside built-in and global agents.
26
+ - **Project-scoped items save to the correct directory** — fixes items being written to the wrong project root when saving to `.openfox/`.
27
+
3
28
  ## 2.0.101 - 2026-07-28
4
29
 
5
30
  ### Features
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.103 - 2026-07-30
4
+
5
+ ### Bug Fixes
6
+
7
+ - **LSP server crashes no longer freeze write_file/edit_file** — rapid process deaths during startup (e.g., rust-analyzer missing on macOS) are now caught early, letting the tool complete normally.
8
+ - **Hung LSP servers time out after 5 seconds** — the initialize handshake now has a timeout, preventing a non-responsive server from blocking the agent loop.
9
+
10
+ ## 2.0.102 - 2026-07-29
11
+
12
+ ### Features
13
+
14
+ - **Assign any agent a specific model override** — each agent can now be assigned a provider+model that kicks in when that agent is selected, overriding the session or global model.
15
+ - **Control MCP tool access per agent** — choose All, None, or pick individual MCP tools for each agent with a three-state permission selector.
16
+
17
+ ### Enhancements
18
+
19
+ - **Browser skill updated to @playwright/cli v1.1.0** — the browser-control skill now references the official Playwright CLI package.
20
+
21
+ ### Bug Fixes
22
+
23
+ - **Workflow step_done nudge fires on every iteration after resume** — when a resumed workflow loops back, the step_done reminder is now injected on every subsequent turn, not just the first.
24
+ - **Systemd service works in headless/SSH environments** — dropped the dependency on `graphical-session.target` so the service installs and runs without a desktop session. Auto-detects headless mode, with `--headless`/`--desktop` flags for explicit control.
25
+ - **Project agents appear in the mode switcher dropdown** — project-scoped custom agents are now listed alongside built-in and global agents.
26
+ - **Project-scoped items save to the correct directory** — fixes items being written to the wrong project root when saving to `.openfox/`.
27
+
3
28
  ## 2.0.101 - 2026-07-28
4
29
 
5
30
  ### Features
@@ -2,43 +2,44 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-E2CSSHSI.js";
5
+ } from "./chunk-W5RC44R6.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-CFTT46KH.js";
9
- import "./chunk-MO3GJIT3.js";
8
+ } from "./chunk-QL2G5UWE.js";
9
+ import "./chunk-Z753S3X7.js";
10
+ import "./chunk-DPRJYQ5U.js";
11
+ import "./chunk-MGKS2NG2.js";
12
+ import "./chunk-5ZJYEINJ.js";
13
+ import "./chunk-4Z2ARCY3.js";
10
14
  import "./chunk-ZASSAZ73.js";
11
- import "./chunk-HAFRPV7I.js";
15
+ import "./chunk-KLK5N4OX.js";
12
16
  import "./chunk-I72ACQ6R.js";
13
- import "./chunk-NWO6GRYE.js";
17
+ import "./chunk-JE7LW7Y6.js";
14
18
  import "./chunk-VKWVPQJ5.js";
15
19
  import "./chunk-D3SXT3BL.js";
16
20
  import "./chunk-J7GAZGZT.js";
17
- import "./chunk-IXFEXEUL.js";
18
- import "./chunk-KQPDU65K.js";
19
- import "./chunk-XLI6PDJG.js";
20
- import "./chunk-G5JFKTSR.js";
21
+ import "./chunk-7HIJP4PC.js";
22
+ import "./chunk-ZLCPNTRT.js";
23
+ import {
24
+ getEventStore
25
+ } from "./chunk-WPCYFH6X.js";
21
26
  import {
22
27
  createChatMessageMessage,
23
28
  createPhaseChangedMessage,
24
29
  createSessionRunningMessage
25
30
  } from "./chunk-27SDWNKL.js";
26
31
  import "./chunk-EU3WWTFH.js";
32
+ import "./chunk-KKEBXFB3.js";
33
+ import "./chunk-W5FTCTGY.js";
27
34
  import "./chunk-WWFH5GAR.js";
28
- import "./chunk-AY37NB76.js";
29
- import "./chunk-MRWR3SIT.js";
30
- import {
31
- getEventStore
32
- } from "./chunk-KNYPBXPW.js";
33
- import "./chunk-NLN5LPQ4.js";
34
- import "./chunk-O2PLNJIU.js";
35
- import "./chunk-ZIMGU5ZH.js";
36
- import "./chunk-3LRYZ7R3.js";
35
+ import "./chunk-2EYTYXWN.js";
36
+ import "./chunk-RZC6DAT2.js";
37
+ import "./chunk-FQS7A5M4.js";
37
38
  import "./chunk-J2GP3J3X.js";
38
39
  import "./chunk-V4IE7HJY.js";
39
40
  import "./chunk-YHEQTVFV.js";
40
- import "./chunk-UIK6GA3P.js";
41
- import "./chunk-UEOEA6BB.js";
41
+ import "./chunk-KCED2X4H.js";
42
+ import "./chunk-YZSBJUGC.js";
42
43
  import "./chunk-GLF65XDS.js";
43
44
  import "./chunk-K44MW7JJ.js";
44
45
  import "./chunk-4R7G5JB6.js";
@@ -165,4 +166,4 @@ export {
165
166
  startChatSession,
166
167
  stopSessionExecution
167
168
  };
168
- //# sourceMappingURL=chat-handler-YPWT4MAQ.js.map
169
+ //# sourceMappingURL=chat-handler-IBFSBSGV.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveDefaultAgentId
3
- } from "./chunk-3LRYZ7R3.js";
3
+ } from "./chunk-FQS7A5M4.js";
4
4
 
5
5
  // src/server/events/apply-events.ts
6
6
  function markComplete(msg, reason) {
@@ -929,4 +929,4 @@ export {
929
929
  buildSnapshot,
930
930
  buildSnapshotFromSessionState
931
931
  };
932
- //# sourceMappingURL=chunk-O2PLNJIU.js.map
932
+ //# sourceMappingURL=chunk-2EYTYXWN.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getPlatformShell
3
- } from "./chunk-NLN5LPQ4.js";
3
+ } from "./chunk-KKEBXFB3.js";
4
4
 
5
5
  // src/server/tools/tool-policy.ts
6
6
  var ALWAYS_ALLOWED = /* @__PURE__ */ new Set(["step_done"]);
@@ -245,4 +245,4 @@ export {
245
245
  buildAgentSmallReminder,
246
246
  COMPACTION_PROMPT
247
247
  };
248
- //# sourceMappingURL=chunk-MRWR3SIT.js.map
248
+ //# sourceMappingURL=chunk-4Z2ARCY3.js.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-YHEQTVFV.js";
10
10
  import {
11
11
  buildModelParams
12
- } from "./chunk-UIK6GA3P.js";
12
+ } from "./chunk-KCED2X4H.js";
13
13
  import {
14
14
  logger
15
15
  } from "./chunk-K44MW7JJ.js";
@@ -438,4 +438,4 @@ export {
438
438
  createChatDoneEvent,
439
439
  consumeStreamGenerator
440
440
  };
441
- //# sourceMappingURL=chunk-AY37NB76.js.map
441
+ //# sourceMappingURL=chunk-5ZJYEINJ.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createMessageStartEvent
3
- } from "./chunk-AY37NB76.js";
3
+ } from "./chunk-5ZJYEINJ.js";
4
4
  import {
5
5
  COMPACTION_PROMPT
6
- } from "./chunk-MRWR3SIT.js";
6
+ } from "./chunk-4Z2ARCY3.js";
7
7
  import {
8
8
  getCurrentWindowMessageOptions
9
- } from "./chunk-KNYPBXPW.js";
9
+ } from "./chunk-WPCYFH6X.js";
10
10
 
11
11
  // src/server/context/compactor.ts
12
12
  function appendCompactionPrompt(sessionId, append) {
@@ -36,4 +36,4 @@ export {
36
36
  COMPACTION_MAX_RATIO,
37
37
  shouldCompact
38
38
  };
39
- //# sourceMappingURL=chunk-XTKLA4AK.js.map
39
+ //# sourceMappingURL=chunk-73EV6QYX.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  updateSessionMcpDisabledServers
3
- } from "./chunk-ZIMGU5ZH.js";
3
+ } from "./chunk-RZC6DAT2.js";
4
4
  import {
5
5
  getDatabase
6
6
  } from "./chunk-GLF65XDS.js";
@@ -62,4 +62,4 @@ export {
62
62
  clearSessionOverrides,
63
63
  getAllSessionOverrides
64
64
  };
65
- //# sourceMappingURL=chunk-XLI6PDJG.js.map
65
+ //# sourceMappingURL=chunk-7HIJP4PC.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createLLMClient
3
- } from "./chunk-VJILJ22N.js";
3
+ } from "./chunk-BJDQPILB.js";
4
4
  import {
5
5
  getModelProfile
6
6
  } from "./chunk-V4IE7HJY.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-HNCM3D7Y.js";
15
15
  import {
16
16
  resolveAttachmentsInMessages
17
- } from "./chunk-UIK6GA3P.js";
17
+ } from "./chunk-KCED2X4H.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-K44MW7JJ.js";
@@ -808,4 +808,4 @@ export {
808
808
  parseDefaultModelSelection,
809
809
  createProviderManager
810
810
  };
811
- //# sourceMappingURL=chunk-W77HIJGH.js.map
811
+ //# sourceMappingURL=chunk-AI27N57J.js.map
@@ -13,11 +13,11 @@ import {
13
13
  getThinking,
14
14
  mapFinishReason,
15
15
  parseToolArguments
16
- } from "./chunk-UIK6GA3P.js";
16
+ } from "./chunk-KCED2X4H.js";
17
17
  import {
18
18
  LLMError,
19
19
  OpenAIHttpClient
20
- } from "./chunk-TDHDLDGQ.js";
20
+ } from "./chunk-MR7ZEGOF.js";
21
21
  import {
22
22
  logger
23
23
  } from "./chunk-K44MW7JJ.js";
@@ -310,4 +310,4 @@ function createLLMClient(config, initialBackend = "unknown") {
310
310
  export {
311
311
  createLLMClient
312
312
  };
313
- //# sourceMappingURL=chunk-VJILJ22N.js.map
313
+ //# sourceMappingURL=chunk-BJDQPILB.js.map
@@ -1,3 +1,25 @@
1
+ import {
2
+ findSkillById,
3
+ getAllInstructions,
4
+ getEnabledSkillMetadata,
5
+ isSkillEnabled,
6
+ loadAllSkills
7
+ } from "./chunk-MGKS2NG2.js";
8
+ import {
9
+ TurnMetrics,
10
+ consumeStreamGenerator,
11
+ createChatDoneEvent,
12
+ createMessageDoneEvent,
13
+ createMessageStartEvent,
14
+ createToolCallEvent,
15
+ createToolResultEvent,
16
+ streamLLMPure
17
+ } from "./chunk-5ZJYEINJ.js";
18
+ import {
19
+ COMPACTION_PROMPT,
20
+ buildBasePrompt,
21
+ computeEffectiveTools
22
+ } from "./chunk-4Z2ARCY3.js";
1
23
  import {
2
24
  startInspectProxy
3
25
  } from "./chunk-ZASSAZ73.js";
@@ -11,7 +33,7 @@ import {
11
33
  spawnShellProcess,
12
34
  startProcessCommand,
13
35
  stopProcess
14
- } from "./chunk-HAFRPV7I.js";
36
+ } from "./chunk-KLK5N4OX.js";
15
37
  import {
16
38
  getMaxPerSession,
17
39
  getSessionProcessCount,
@@ -19,7 +41,7 @@ import {
19
41
  } from "./chunk-I72ACQ6R.js";
20
42
  import {
21
43
  createMcpTools
22
- } from "./chunk-NWO6GRYE.js";
44
+ } from "./chunk-JE7LW7Y6.js";
23
45
  import {
24
46
  applyMcpServerUpdate
25
47
  } from "./chunk-VKWVPQJ5.js";
@@ -28,23 +50,21 @@ import {
28
50
  isGitRepository,
29
51
  listWorkspaces
30
52
  } from "./chunk-D3SXT3BL.js";
31
- import {
32
- findSkillById,
33
- getAllInstructions,
34
- getEnabledSkillMetadata,
35
- isSkillEnabled,
36
- loadAllSkills
37
- } from "./chunk-KQPDU65K.js";
38
53
  import {
39
54
  getSessionDisabledServers
40
- } from "./chunk-XLI6PDJG.js";
55
+ } from "./chunk-7HIJP4PC.js";
41
56
  import {
42
57
  PathAccessDeniedError,
43
58
  extractAbsolutePathsFromCommand,
44
59
  extractSensitivePathsFromCommand,
45
60
  registerPathConfirmation,
46
61
  requestPathAccess
47
- } from "./chunk-G5JFKTSR.js";
62
+ } from "./chunk-ZLCPNTRT.js";
63
+ import {
64
+ getCurrentContextWindowId,
65
+ getCurrentWindowMessageOptions,
66
+ getEventStore
67
+ } from "./chunk-WPCYFH6X.js";
48
68
  import {
49
69
  createChatDoneMessage,
50
70
  createChatMessageMessage,
@@ -57,25 +77,8 @@ import {
57
77
  askUserTool
58
78
  } from "./chunk-EU3WWTFH.js";
59
79
  import {
60
- TurnMetrics,
61
- consumeStreamGenerator,
62
- createChatDoneEvent,
63
- createMessageDoneEvent,
64
- createMessageStartEvent,
65
- createToolCallEvent,
66
- createToolResultEvent,
67
- streamLLMPure
68
- } from "./chunk-AY37NB76.js";
69
- import {
70
- COMPACTION_PROMPT,
71
- buildBasePrompt,
72
- computeEffectiveTools
73
- } from "./chunk-MRWR3SIT.js";
74
- import {
75
- getCurrentContextWindowId,
76
- getCurrentWindowMessageOptions,
77
- getEventStore
78
- } from "./chunk-KNYPBXPW.js";
80
+ resolveLLMClientForAgent
81
+ } from "./chunk-W5FTCTGY.js";
79
82
  import {
80
83
  buildContextMessagesFromEventHistory,
81
84
  foldContextState,
@@ -85,13 +88,13 @@ import {
85
88
  handleToolResult,
86
89
  reorderToolMessages,
87
90
  stripOrphanedToolCalls
88
- } from "./chunk-O2PLNJIU.js";
91
+ } from "./chunk-2EYTYXWN.js";
89
92
  import {
90
93
  findAgentById,
91
94
  getRuntimeConfig,
92
95
  getSubAgents,
93
96
  loadAllAgentsDefault
94
- } from "./chunk-3LRYZ7R3.js";
97
+ } from "./chunk-FQS7A5M4.js";
95
98
  import {
96
99
  modelSupportsVision
97
100
  } from "./chunk-V4IE7HJY.js";
@@ -105,11 +108,11 @@ import {
105
108
  formatPdfErrorMessage,
106
109
  isPdfBuffer,
107
110
  processPdfContent
108
- } from "./chunk-UIK6GA3P.js";
111
+ } from "./chunk-KCED2X4H.js";
109
112
  import {
110
113
  SETTINGS_KEYS,
111
114
  getSetting
112
- } from "./chunk-UEOEA6BB.js";
115
+ } from "./chunk-YZSBJUGC.js";
113
116
  import {
114
117
  logger
115
118
  } from "./chunk-K44MW7JJ.js";
@@ -133,7 +136,7 @@ async function requestUserConfirmation(context, toolLabel, desc) {
133
136
  if (context.dangerLevel === "dangerous") return Promise.resolve(true);
134
137
  if (toolLabel === "workspace" || toolLabel === "command") {
135
138
  try {
136
- const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-2WVGUPYV.js");
139
+ const { getSetting: getSetting2, SETTINGS_KEYS: SETTINGS_KEYS2 } = await import("./settings-FT7HF7ZB.js");
137
140
  if (getSetting2(SETTINGS_KEYS2.CONFIRM_ON_WORKSPACE_ACTIONS) !== "true") {
138
141
  return Promise.resolve(true);
139
142
  }
@@ -1624,6 +1627,9 @@ async function executeTools(assistantMsgId, toolCalls, ctx, append) {
1624
1627
  if (ctx.isSubAgent) {
1625
1628
  toolContext.isSubAgent = true;
1626
1629
  }
1630
+ if (ctx.providerManager) {
1631
+ toolContext.providerManager = ctx.providerManager;
1632
+ }
1627
1633
  const startTime = Date.now();
1628
1634
  let toolResult;
1629
1635
  try {
@@ -1839,7 +1845,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
1839
1845
  const previousContextTokens = contextState.currentTokens;
1840
1846
  const contextWindow = sessionManager.getCurrentModelContext();
1841
1847
  const availableForOutput = Math.max(256, contextWindow - contextState.currentTokens);
1842
- let modelSettings = currentMaxTokensOverride !== void 0 ? { ...sessionManager.getCurrentModelSettings(sessionId), maxTokens: currentMaxTokensOverride } : sessionManager.getCurrentModelSettings(sessionId);
1848
+ let modelSettings = config.modelSettings ?? (currentMaxTokensOverride !== void 0 ? { ...sessionManager.getCurrentModelSettings(sessionId), maxTokens: currentMaxTokensOverride } : sessionManager.getCurrentModelSettings(sessionId));
1843
1849
  if (modelSettings) {
1844
1850
  const requestedMaxTokens = modelSettings.maxTokens ?? 16384;
1845
1851
  modelSettings = { ...modelSettings, maxTokens: Math.min(requestedMaxTokens, availableForOutput) };
@@ -1913,7 +1919,7 @@ ${CONTINUE_PROMPT}` : CONTINUE_PROMPT;
1913
1919
  sessionManager.setCurrentContextSize(sessionId, result.usage.promptTokens, config.subAgentMetadata?.subAgentId);
1914
1920
  if (!compacting) {
1915
1921
  const contextState2 = sessionManager.getContextState(sessionId);
1916
- const { shouldCompact, appendCompactionPrompt } = await import("./compactor-B4V75Q3A.js");
1922
+ const { shouldCompact, appendCompactionPrompt } = await import("./compactor-43P3LGDU.js");
1917
1923
  if (shouldCompact(
1918
1924
  contextState2.currentTokens,
1919
1925
  contextState2.maxTokens,
@@ -2012,6 +2018,9 @@ ${COMPACTION_PROMPT}`,
2012
2018
  if (config.subAgentMetadata) {
2013
2019
  batchContext.isSubAgent = true;
2014
2020
  }
2021
+ if (config.providerManager) {
2022
+ batchContext.providerManager = config.providerManager;
2023
+ }
2015
2024
  batchContext.agentTimeout = getRuntimeConfig().agent.toolTimeout;
2016
2025
  const batchResult = await executeTools(assistantMsgId, result.toolCalls, batchContext, append);
2017
2026
  if (batchResult.stepDoneCalled) {
@@ -2672,10 +2681,11 @@ async function executeSubAgent(options) {
2672
2681
  prompt,
2673
2682
  sessionManager,
2674
2683
  sessionId,
2675
- llmClient,
2684
+ llmClient: parentLlmClient,
2676
2685
  toolRegistry,
2677
2686
  turnMetrics,
2678
- statsIdentity,
2687
+ statsIdentity: parentStatsIdentity,
2688
+ providerManager,
2679
2689
  signal,
2680
2690
  onMessage
2681
2691
  } = options;
@@ -2684,6 +2694,52 @@ async function executeSubAgent(options) {
2684
2694
  const subAgentId = crypto.randomUUID();
2685
2695
  const session = sessionManager.requireSession(sessionId);
2686
2696
  const windowOptions = getWindowOptions(sessionId);
2697
+ let llmClient = parentLlmClient;
2698
+ let statsIdentity = parentStatsIdentity;
2699
+ let hasOverride = false;
2700
+ let overrideModelSettings;
2701
+ if (providerManager) {
2702
+ const resolved = resolveLLMClientForAgent(subAgentType, parentLlmClient, providerManager);
2703
+ if (resolved.usedOverride && resolved.override) {
2704
+ hasOverride = true;
2705
+ llmClient = resolved.client;
2706
+ const provider = providerManager.getProviders().find((p) => p.id === resolved.override.providerId);
2707
+ statsIdentity = {
2708
+ providerId: resolved.override.providerId,
2709
+ providerName: provider?.name ?? resolved.override.providerId,
2710
+ backend: provider?.backend ?? resolved.client.getBackend(),
2711
+ model: resolved.override.model
2712
+ };
2713
+ overrideModelSettings = providerManager.getModelSettings(resolved.override.providerId, resolved.override.model);
2714
+ logger.info("Sub-agent using model override", { subAgentType, ...resolved.override });
2715
+ } else if (resolved.warning) {
2716
+ logger.warn("Sub-agent model override unavailable, falling back", { subAgentType, warning: resolved.warning });
2717
+ const warningMsgId = crypto.randomUUID();
2718
+ eventStore.append(
2719
+ sessionId,
2720
+ createMessageStartEvent(warningMsgId, "system", resolved.warning, {
2721
+ ...windowOptions ?? {},
2722
+ isSystemGenerated: true,
2723
+ subAgentId,
2724
+ subAgentType
2725
+ })
2726
+ );
2727
+ eventStore.append(sessionId, { type: "message.done", data: { messageId: warningMsgId } });
2728
+ if (onMessage) {
2729
+ onMessage(
2730
+ createChatMessageMessage({
2731
+ id: warningMsgId,
2732
+ role: "system",
2733
+ content: resolved.warning,
2734
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2735
+ isSystemGenerated: true,
2736
+ subAgentId,
2737
+ subAgentType
2738
+ })
2739
+ );
2740
+ }
2741
+ }
2742
+ }
2687
2743
  logger.debug("Sub-agent starting", { subAgentType, subAgentId, sessionId });
2688
2744
  const resetMsgId = crypto.randomUUID();
2689
2745
  eventStore.append(
@@ -2750,6 +2806,9 @@ async function executeSubAgent(options) {
2750
2806
  sessionId,
2751
2807
  llmClient,
2752
2808
  statsIdentity,
2809
+ providerManager,
2810
+ // When an override is active, use its model settings (or empty to avoid leaking session settings)
2811
+ ...hasOverride ? { modelSettings: overrideModelSettings ?? {} } : {},
2753
2812
  signal,
2754
2813
  onMessage,
2755
2814
  assembleRequest: async (input) => createAssemblyResult({
@@ -2838,7 +2897,7 @@ var callSubAgentTool = {
2838
2897
  truncated: false
2839
2898
  };
2840
2899
  }
2841
- const { sessionId, sessionManager, llmClient, statsIdentity } = context;
2900
+ const { sessionId, sessionManager, llmClient, statsIdentity, providerManager } = context;
2842
2901
  if (!sessionId || !sessionManager || !llmClient) {
2843
2902
  return {
2844
2903
  success: false,
@@ -2848,7 +2907,7 @@ var callSubAgentTool = {
2848
2907
  };
2849
2908
  }
2850
2909
  try {
2851
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-X5FONL4Q.js");
2910
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-M5DKWCJJ.js");
2852
2911
  const toolRegistry = getToolRegistryForAgent2(agentDef);
2853
2912
  const turnMetrics = new TurnMetrics();
2854
2913
  const result = await executeSubAgent({
@@ -2859,6 +2918,7 @@ var callSubAgentTool = {
2859
2918
  llmClient,
2860
2919
  toolRegistry,
2861
2920
  turnMetrics,
2921
+ providerManager,
2862
2922
  statsIdentity: statsIdentity ?? {
2863
2923
  providerId: "unknown",
2864
2924
  providerName: "Unknown",
@@ -3869,7 +3929,7 @@ var mcpConfigTool = createTool(
3869
3929
  mcpNotifyChanged?.(sessionId);
3870
3930
  }
3871
3931
  async function rebuildTools() {
3872
- const { setMcpTools: setMcpTools2 } = await import("./tools-X5FONL4Q.js");
3932
+ const { setMcpTools: setMcpTools2 } = await import("./tools-M5DKWCJJ.js");
3873
3933
  const mcpTools = createMcpTools(mcpManagerForTools);
3874
3934
  setMcpTools2(mcpTools);
3875
3935
  }
@@ -4344,6 +4404,34 @@ function createRegistryFromTools(tools, allowedTools, toolPermissions, agentId,
4344
4404
  if (tool) {
4345
4405
  const isMcpTool = !getBuiltInToolNames().has(name);
4346
4406
  const hasRestrictions = allowedTools !== void 0;
4407
+ if (isMcpTool && hasRestrictions) {
4408
+ const hasMcpNone = allowedTools.includes("__mcp_none__");
4409
+ const hasMcpSpecific = allowedTools.some((t) => !getBuiltInToolNames().has(t) && t !== "__mcp_none__");
4410
+ if (hasMcpNone) {
4411
+ logger.debug("Permission denied: MCP tools disabled for this agent", {
4412
+ tool: name,
4413
+ allowedTools
4414
+ });
4415
+ return {
4416
+ success: false,
4417
+ error: createPermissionErrorMessage(name, allowedTools, agentId, isSubAgent),
4418
+ durationMs: 0,
4419
+ truncated: false
4420
+ };
4421
+ }
4422
+ if (hasMcpSpecific && !allowedTools.includes(name)) {
4423
+ logger.debug("Permission denied: MCP tool not in allowed list", {
4424
+ tool: name,
4425
+ allowedTools
4426
+ });
4427
+ return {
4428
+ success: false,
4429
+ error: createPermissionErrorMessage(name, allowedTools, agentId, isSubAgent),
4430
+ durationMs: 0,
4431
+ truncated: false
4432
+ };
4433
+ }
4434
+ }
4347
4435
  if (!isMcpTool && hasRestrictions) {
4348
4436
  const effectiveTools = computeEffectiveTools(allowedTools, isSubAgent ? "sub-agent" : "agent");
4349
4437
  if (!effectiveTools.has(name)) {
@@ -4506,6 +4594,7 @@ export {
4506
4594
  setMcpConfigMode,
4507
4595
  setMcpConfigPath,
4508
4596
  setNotifyMcpServersChanged,
4597
+ getBuiltInToolNames,
4509
4598
  parseToolPermissions,
4510
4599
  getToolPermissions,
4511
4600
  validateToolAction,
@@ -4515,4 +4604,4 @@ export {
4515
4604
  getToolRegistryForAgent,
4516
4605
  createToolRegistry
4517
4606
  };
4518
- //# sourceMappingURL=chunk-MO3GJIT3.js.map
4607
+ //# sourceMappingURL=chunk-DPRJYQ5U.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SETTINGS_KEYS,
3
3
  getSetting
4
- } from "./chunk-UEOEA6BB.js";
4
+ } from "./chunk-YZSBJUGC.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-K44MW7JJ.js";
@@ -455,4 +455,4 @@ export {
455
455
  getOverrideAgentIds,
456
456
  resolveDefaultAgentId
457
457
  };
458
- //# sourceMappingURL=chunk-3LRYZ7R3.js.map
458
+ //# sourceMappingURL=chunk-FQS7A5M4.js.map
@@ -16,6 +16,7 @@ function createMcpTools(mcpManager) {
16
16
  tools.push({
17
17
  name: prefixedName,
18
18
  definition,
19
+ mcpServer: server.name,
19
20
  execute: async (args, _context) => {
20
21
  const start = Date.now();
21
22
  const result = await mcpManager.callTool(server.name, mcpTool.name, args);
@@ -36,4 +37,4 @@ function createMcpTools(mcpManager) {
36
37
  export {
37
38
  createMcpTools
38
39
  };
39
- //# sourceMappingURL=chunk-NWO6GRYE.js.map
40
+ //# sourceMappingURL=chunk-JE7LW7Y6.js.map
@@ -163,13 +163,13 @@ async function runCli(options) {
163
163
  break;
164
164
  }
165
165
  case "provider": {
166
- const { runProviderCommand } = await import("./provider-PEJ27FBM.js");
166
+ const { runProviderCommand } = await import("./provider-FX3QCGAF.js");
167
167
  const [, subcommand] = positionals;
168
168
  await runProviderCommand(mode, subcommand);
169
169
  break;
170
170
  }
171
171
  case "service": {
172
- const { runServiceCommand } = await import("./service-2PW2V25M.js");
172
+ const { runServiceCommand } = await import("./service-CXWJQFOZ.js");
173
173
  const [, subcommand, ...serviceArgs] = positionals;
174
174
  if (values.follow) {
175
175
  serviceArgs.push("-f");
@@ -200,7 +200,7 @@ async function runCli(options) {
200
200
  break;
201
201
  }
202
202
  case "update": {
203
- const { runUpdate } = await import("./update-GHS75L7T.js");
203
+ const { runUpdate } = await import("./update-KMPQUPQT.js");
204
204
  const code = await runUpdate();
205
205
  if (code !== 0) {
206
206
  process.exit(code);
@@ -213,7 +213,7 @@ async function runCli(options) {
213
213
  if (!configExists) {
214
214
  await runNetworkSetup(mode);
215
215
  }
216
- const { runServe } = await import("./serve-KM2RVX2U.js");
216
+ const { runServe } = await import("./serve-FE4UAXGE.js");
217
217
  const serveOptions = { mode };
218
218
  if (values.port) serveOptions.port = parseInt(values.port);
219
219
  if (values["no-browser"] === true) serveOptions.openBrowser = false;
@@ -225,4 +225,4 @@ async function runCli(options) {
225
225
  export {
226
226
  runCli
227
227
  };
228
- //# sourceMappingURL=chunk-MBYXZ5V5.js.map
228
+ //# sourceMappingURL=chunk-JL657X72.js.map