mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-22 20:52:23 +02:00
Merge remote-tracking branch 'origin/eric/dev' into eric/dev
This commit is contained in:
@@ -61,8 +61,8 @@ def _delete(dashboard_id: str):
|
||||
os.remove(path)
|
||||
|
||||
|
||||
def _migrate_if_needed():
|
||||
"""One-time migration: if no dashboards exist, create 'Dashboard 1' from old layout."""
|
||||
def migrate_if_needed():
|
||||
"""One-time migration: if no dashboards exist, create the default from old layout."""
|
||||
existing = _load_all()
|
||||
if existing:
|
||||
return
|
||||
@@ -80,7 +80,7 @@ def _migrate_if_needed():
|
||||
except Exception:
|
||||
logger.exception("Failed to read old layout.json, using empty layout")
|
||||
|
||||
dashboard = Dashboard(name="Dashboard 1", layout=layout)
|
||||
dashboard = Dashboard(name="Untitled Dashboard", layout=layout)
|
||||
_save(dashboard)
|
||||
logger.info(f"Created default dashboard: {dashboard.id}")
|
||||
|
||||
@@ -105,7 +105,7 @@ def _migrate_if_needed():
|
||||
@asynccontextmanager
|
||||
async def dashboards_lifespan():
|
||||
os.makedirs(DATA_DIR, exist_ok=True)
|
||||
_migrate_if_needed()
|
||||
migrate_if_needed()
|
||||
yield
|
||||
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ def test_migration_survives_corrupt_session(tmp_path, monkeypatch):
|
||||
(sess_dir / "good.json").write_text(json.dumps({"id": "good"}))
|
||||
(sess_dir / "bad.json").write_text("{ truncated ,,,")
|
||||
|
||||
dmod._migrate_if_needed() # must not raise despite the corrupt session
|
||||
dmod.migrate_if_needed() # must not raise despite the corrupt session
|
||||
|
||||
dashboards = dmod._load_all()
|
||||
assert len(dashboards) == 1
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "openswarm",
|
||||
"version": "1.2.77",
|
||||
"version": "1.2.84",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "openswarm",
|
||||
"version": "1.2.77",
|
||||
"version": "1.2.84",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"electron-updater": "6.8.3",
|
||||
|
||||
+11
-9
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openswarm",
|
||||
"version": "1.2.83",
|
||||
"version": "1.2.84",
|
||||
"description": "OpenSwarm — AI Agent Orchestrator",
|
||||
"author": "openswarm-ai",
|
||||
"main": "main.js",
|
||||
@@ -51,7 +51,16 @@
|
||||
"category": "public.app-category.developer-tools",
|
||||
"hardenedRuntime": true,
|
||||
"entitlements": "build/entitlements.mac.plist",
|
||||
"entitlementsInherit": "build/entitlements.mac.plist"
|
||||
"entitlementsInherit": "build/entitlements.mac.plist",
|
||||
"extraResources": [
|
||||
{
|
||||
"from": "build-staging/mouseclamp/${arch}",
|
||||
"to": "mouseclamp",
|
||||
"filter": [
|
||||
"**/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"dmg": {
|
||||
"artifactName": "OpenSwarm-${arch}.${ext}",
|
||||
@@ -149,13 +158,6 @@
|
||||
"**/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from": "build-staging/mouseclamp/${arch}",
|
||||
"to": "mouseclamp",
|
||||
"filter": [
|
||||
"**/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from": "build-staging/uv-bin/${arch}",
|
||||
"to": "backend/uv-bin",
|
||||
|
||||
@@ -215,12 +215,7 @@ export function useAgentSpawn({
|
||||
(s) => s.status !== 'draft' && s.dashboard_id === dashboardId,
|
||||
).length;
|
||||
const NAME_GEN_TRIGGERS = [1, 3, 6];
|
||||
const currentDash = store.getState().dashboards.items[dashboardId];
|
||||
const canAutoName =
|
||||
currentDash &&
|
||||
(currentDash.auto_named || currentDash.name === 'Untitled Dashboard');
|
||||
|
||||
if (NAME_GEN_TRIGGERS.includes(agentCount) && canAutoName) {
|
||||
if (NAME_GEN_TRIGGERS.includes(agentCount)) {
|
||||
dispatch(generateDashboardName(dashboardId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,16 +255,13 @@ export function useDashboardLifecycle({
|
||||
|
||||
const namedOnFirstMessageRef = useRef<string | null>(null);
|
||||
useEffect(() => {
|
||||
if (!dashboardId || !layoutInitialized) return;
|
||||
if (!dashboardId) return;
|
||||
if (namedOnFirstMessageRef.current === dashboardId) return;
|
||||
const dash = store.getState().dashboards.items[dashboardId];
|
||||
if (!dash) return;
|
||||
if (!dash.auto_named && dash.name !== 'Untitled Dashboard') return;
|
||||
const hasUserMessage = Object.values(sessions).some(
|
||||
(s) => s.dashboard_id === dashboardId && s.messages?.some((m) => m.role === 'user'),
|
||||
);
|
||||
if (!hasUserMessage) return;
|
||||
namedOnFirstMessageRef.current = dashboardId;
|
||||
dispatch(generateDashboardName(dashboardId));
|
||||
}, [sessions, dashboardId, layoutInitialized, dispatch]);
|
||||
}, [sessions, dashboardId, dispatch]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user