Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

fix(device): a tab pick on the dial names the whole tab id

0xdiego25b12b333aa8cb
diff --git a/devices/harness-device/firmware/main/cable_client.c b/devices/harness-device/firmware/main/cable_client.c
index c990a93f5..94676f2e1 100644
--- a/devices/harness-device/firmware/main/cable_client.c
+++ b/devices/harness-device/firmware/main/cable_client.c
@@ -405,7 +405,7 @@ static const char *str_of(const cJSON *o, const char *key)
// (the window's default is "New swarm", but a blank one still has to be a row that can be picked).
static void handle_swarms(const cJSON *p)
{
- static cable_swarm_t rows[SWARMS_MAX]; // static: 24 × ~76 B is too much for the reader task's stack
+ static cable_swarm_t rows[SWARMS_MAX]; // static: 24 × ~96 B is too much for the reader task's stack
int n = 0;
const cJSON *it = NULL;
cJSON_ArrayForEach(it, cJSON_GetObjectItemCaseSensitive(p, "items")) {
diff --git a/devices/harness-device/firmware/main/cable_client.h b/devices/harness-device/firmware/main/cable_client.h
index 4bd5ddb47..17391d6c4 100644
--- a/devices/harness-device/firmware/main/cable_client.h
+++ b/devices/harness-device/firmware/main/cable_client.h
@@ -143,7 +143,12 @@ const char *cable_client_machine_id(void);
// in one `swarms` frame whenever it changes, and relays a pick back to the window — which switches, and
// re-describes its desk. The dial never answers a swarm frame; the next `swarms` + agent list IS the
// answer. No window → an empty list, and the tile draws no swarm line.
-#define SWARM_ID_MAX 32
+// A desk id is 32 HEX CHARACTERS (desktop desk_sync.dart `newDeskId`), so a 32-byte buffer held 31 of
+// them and the NUL. The list still drew right — both sides of every comparison here were truncated the
+// same way — but each pick named a tab the window does not have, and the daemon dropped it
+// ("ignored select for unknown swarm"): tapping a tab on the dial did nothing at all. Same cap as an
+// agent id, which already counts its NUL.
+#define SWARM_ID_MAX ID_MAX
#define SWARMS_MAX 24 // the window's own ceiling (AppNotifier.maxSwarms)
typedef struct {
char id[SWARM_ID_MAX];