Skip to content

Commit 441da82

Browse files
authored
Merge pull request #22 from aimed-lab/dev
Release 1.131 → main: copilot current-network fix
2 parents 347e753 + 63d3e92 commit 441da82

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 1.131 — 2026-06-07
4+
5+
Copilot fix: the Assistant now operates on the **currently-loaded network**.
6+
7+
- The Assistant sends the UI's current edge list to the agent service, so
8+
"analyze the network / this network / the current network" runs
9+
`spinner_analyze` on what's on screen (previously the stateless service had
10+
no knowledge of the loaded graph and replied "no network analyzed yet").
11+
- The local-vs-copilot router no longer treats `analyze` / `geneterrain` /
12+
`rescore` as local UI commands — those reach the copilot; pure UI toggles
13+
and routing stay local.
14+
315
## 1.130 — 2026-06-07
416

517
Assistant copilot. The Assistant drawer can now drive the full

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "spinner-net"
7-
version = "1.130"
7+
version = "1.131"
88
description = "network SPINNER: Seeded Protein Interaction Network Neighborhood Expansion and Ranking"
99
readme = "README.md"
1010
requires-python = ">=3.9"

src/spinner/web/app.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,10 @@ function isLocalUiCommand(text) {
19831983
// contain a UI keyword ("analyze this network and rank targets…").
19841984
const t = text.trim().toLowerCase();
19851985
if (t.length > 60 || t.includes("?") || t.split(/\s+/).length > 8) return false;
1986-
return /^(show|top|set|use|plan|route|trip|generate|geneterrain|analyze|rescore|filter|layout|dema|force|organic|wiper1|wiper2|raw)\b/.test(t)
1986+
// "analyze", "geneterrain", "rescore" intentionally NOT here — those read as
1987+
// analysis / drug-target / cross-tool intent and belong to the copilot (which
1988+
// can also explain and rank). Only pure UI toggles / routing stay local.
1989+
return /^(show|top|set|use|plan|route|trip|generate|filter|layout|dema|force|organic|wiper1|wiper2)\b/.test(t)
19871990
|| /\btop\s+\d+\b/.test(t) || /\d+\s*%/.test(t) || /\d+\s+(nodes?|edges?|iterations?)\b/.test(t);
19881991
}
19891992

@@ -2001,11 +2004,17 @@ async function runCopilot(text) {
20012004
let bubble = null;
20022005
let removedThinking = false;
20032006
const dropThinking = () => { if (thinking && !removedThinking) { thinking.remove(); removedThinking = true; } };
2007+
// Give the copilot the network currently loaded in the UI, so "analyze the
2008+
// network / this network / the current network" operates on what's on screen.
2009+
const edges = ((els.edgeText && els.edgeText.value) || "").trim();
2010+
const message = edges
2011+
? `[Currently loaded SPINNER network — when I refer to "the network", "this network", or "the current network", call spinner_analyze with exactly these edges:\n${edges}\n]\n\n${text}`
2012+
: text;
20042013
try {
20052014
const resp = await fetch(`${AGENT_BASE}/agent/chat`, {
20062015
method: "POST",
20072016
headers: { "Content-Type": "application/json" },
2008-
body: JSON.stringify({ session_id: AGENT_SESSION, message: text }),
2017+
body: JSON.stringify({ session_id: AGENT_SESSION, message }),
20092018
});
20102019
if (!resp.ok || !resp.body) throw new Error("HTTP " + resp.status);
20112020
const reader = resp.body.getReader();

0 commit comments

Comments
 (0)