@melaya/runner 1.0.101 → 1.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.
- package/dist/assistantHost.py +21 -20
- package/dist/connection.js +6 -1
- package/package.json +1 -1
package/dist/assistantHost.py
CHANGED
|
@@ -271,28 +271,29 @@ def _build_agent():
|
|
|
271
271
|
# then ALWAYS require the in-chat approval card (fail-safe).
|
|
272
272
|
if connector_services and not os.environ.get("MEL_ASSISTANT_CONNECTOR_HITL"):
|
|
273
273
|
os.environ["MEL_ASSISTANT_CONNECTOR_HITL"] = "1"
|
|
274
|
+
# Core primitives (melaya_core): web_search / web_fetch, files, HTTP, data +
|
|
275
|
+
# office utilities, scraping, encoding, SQL, etc. — are ALWAYS discoverable via
|
|
276
|
+
# search_tools/activate_tool. The side-effecting ones run on the USER's OWN
|
|
277
|
+
# machine (this runner) and are HITL-gated by the assistant's safe/payments
|
|
278
|
+
# modes, so exposing them for discovery is safe. They stay in the LAZY pool
|
|
279
|
+
# (not pinned) so the ~73-tool category never explodes the active budget.
|
|
280
|
+
core_categories = ["melaya_core"]
|
|
274
281
|
try:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
active_categories=categories,
|
|
289
|
-
include_categories=categories + connector_services,
|
|
290
|
-
budget=_budget,
|
|
291
|
-
)
|
|
292
|
-
else:
|
|
293
|
-
toolkit = build_toolkit(categories=categories)
|
|
282
|
+
from shared.orchestration.lazy_registry import build_lazy_toolkit
|
|
283
|
+
# Base tools (melaya_agent + phone) stay active+pinned; core + any selected
|
|
284
|
+
# connectors are deferred + discoverable. Phone tasks need the WHOLE phone
|
|
285
|
+
# set pinned (no per-tap search_tools round-trips → the old "slow" regression),
|
|
286
|
+
# so widen the budget when phone is enabled; core/connectors still lazy-defer.
|
|
287
|
+
_budget = int(os.environ.get("MEL_LAZY_BUDGET", "25"))
|
|
288
|
+
if phone_enabled:
|
|
289
|
+
_budget = max(_budget, 64)
|
|
290
|
+
toolkit = build_lazy_toolkit(
|
|
291
|
+
active_categories=categories,
|
|
292
|
+
include_categories=categories + core_categories + connector_services,
|
|
293
|
+
budget=_budget,
|
|
294
|
+
)
|
|
294
295
|
except Exception as exc:
|
|
295
|
-
_log(f"toolkit build failed (connectors={connector_services}): {exc}; retrying melaya_agent only")
|
|
296
|
+
_log(f"toolkit build failed (connectors={connector_services}, core): {exc}; retrying melaya_agent only")
|
|
296
297
|
try:
|
|
297
298
|
toolkit = build_toolkit(categories=["melaya_agent"])
|
|
298
299
|
except Exception:
|
package/dist/connection.js
CHANGED
|
@@ -1034,7 +1034,12 @@ export async function connect(opts) {
|
|
|
1034
1034
|
}
|
|
1035
1035
|
});
|
|
1036
1036
|
proc.on("exit", (code) => {
|
|
1037
|
-
|
|
1037
|
+
// Only evict if WE are still the registered host. A config-drift reboot
|
|
1038
|
+
// (e.g. the user added a connector) kills this host and spawns a REPLACEMENT
|
|
1039
|
+
// under the same sid; if this late exit deleted the map entry blindly it
|
|
1040
|
+
// would orphan the newcomer and make the next turn "session_not_found".
|
|
1041
|
+
if (activeAssistants.get(sid) === session)
|
|
1042
|
+
activeAssistants.delete(sid);
|
|
1038
1043
|
const detail = code !== 0 && stderrTail.length ? stderrTail.slice(-12).join("\n") : "";
|
|
1039
1044
|
socket.emit("runner:assistant_event", { sessionId: sid, turnId: "", kind: "session_closed", code, detail });
|
|
1040
1045
|
console.log(chalk.gray(` ■ Assistant session ${sid.slice(0, 10)}… closed (exit ${code})`));
|