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.

feat(device): a Focus-only build leaves the companion artwork out

0xdiego254a9c3ec99fab
diff --git a/devices/harness-device/firmware/main/CMakeLists.txt b/devices/harness-device/firmware/main/CMakeLists.txt
index 32731fb79..2445a961b 100644
--- a/devices/harness-device/firmware/main/CMakeLists.txt
+++ b/devices/harness-device/firmware/main/CMakeLists.txt
@@ -91,6 +91,15 @@ set(BOARD_REQUIRES
json
)
+# The illustrated companions' artwork is 4.6 MB of the image, and a Focus-only build never draws it,
+# so it ships only with -DDEVICE_ALL_SKINS=1 (owner, 2026-09-30). Without it the code stays and the
+# pack is empty — see illustrated_cache.c.
+if(DEVICE_ALL_SKINS)
+ set(COMPANION_ART "../assets/companions/companion_art.pack")
+else()
+ set(COMPANION_ART "")
+endif()
+
idf_component_register(
SRCS ${BOARD_SRCS}
INCLUDE_DIRS
@@ -98,7 +107,7 @@ idf_component_register(
"ui"
"board"
REQUIRES ${BOARD_REQUIRES}
- EMBED_FILES "../assets/companions/companion_art.pack"
+ EMBED_FILES ${COMPANION_ART}
)
# snprintf() is bounded (it truncates, never overflows), but -O2 enables a noisy
@@ -112,7 +121,7 @@ endif()
# Focus and nothing else until the companion skins are finished (owner, 2026-09-30); the host tests
# build without it and keep covering every skin. -DDEVICE_ALL_SKINS=1 lifts it for a build.
if(NOT DEVICE_ALL_SKINS)
- target_compile_definitions(${COMPONENT_LIB} PRIVATE HABITAT_FOCUS_ONLY=1)
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE HABITAT_FOCUS_ONLY=1 HABITAT_NO_COMPANION_ART=1)
endif()
# Focus unless told otherwise — see ht_character_default().
diff --git a/devices/harness-device/firmware/main/ui/habitat/illustrated_cache.c b/devices/harness-device/firmware/main/ui/habitat/illustrated_cache.c
index d4ac74ed2..e92f300bb 100644
--- a/devices/harness-device/firmware/main/ui/habitat/illustrated_cache.c
+++ b/devices/harness-device/firmware/main/ui/habitat/illustrated_cache.c
@@ -11,8 +11,17 @@
#include <zlib.h>
#endif
+#ifdef HABITAT_NO_COMPANION_ART
+/*
+ * A Focus-only build carries no artwork (main/CMakeLists.txt): the pack is empty, no cache is
+ * allocated, and a sprite that names an asset is dropped rather than decoded. Nothing selects an
+ * illustrated companion in that build, so this is the belt to HABITAT_FOCUS_ONLY's braces.
+ */
+static const uint8_t companion_pack_start[1], *const companion_pack_end = companion_pack_start;
+#else
extern const uint8_t companion_pack_start[] __asm__("_binary_companion_art_pack_start");
extern const uint8_t companion_pack_end[] __asm__("_binary_companion_art_pack_end");
+#endif
typedef struct { uint8_t *memory; uint32_t revision; ht_sprite_t sprite; } cache_t;
static cache_t cache[COMPANION_ROLES];
@@ -54,6 +63,9 @@ static void shrink(uint8_t *memory, unsigned sw, unsigned sh, unsigned dw, unsig
void ht_illustrated_init(void)
{
+#ifdef HABITAT_NO_COMPANION_ART
+ return;
+#endif
for (unsigned i = 0; i < COMPANION_ROLES; i++) {
if (cache[i].memory) continue;
#ifdef ESP_PLATFORM
@@ -71,6 +83,10 @@ void ht_illustrated_prepare(ht_scene_t *scene)
for (unsigned i = 0; i < scene->count; i++) {
ht_sprite_t *sprite = &scene->runs[i].sprite;
if (!sprite->asset) continue;
+#ifdef HABITAT_NO_COMPANION_ART
+ *sprite = (ht_sprite_t){0};
+ continue;
+#endif
const companion_asset_t *asset = sprite->asset;
assert(asset->role < COMPANION_ROLES);
unsigned role = asset->role;