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.

Harness OS: Orange Pi 4 Pro shortcuts, Claude Code and the CLI connections

bubu-duduce89bafc07ca
diff --git a/os/platforms/orangepi-4pro/README.md b/os/platforms/orangepi-4pro/README.md
index c0108dd36..f8492b555 100644
--- a/os/platforms/orangepi-4pro/README.md
+++ b/os/platforms/orangepi-4pro/README.md
@@ -16,6 +16,7 @@ update feed is generated, and the board keeps Debian's own system updates.
| Compositor | labwc 0.20.2 on Arch's wlroots 0.20 | the same labwc source and patch, built with wlroots 0.20.2 and newer Wayland libraries into `/opt/harness-wl` |
| Rendering | GPU | CPU (`WLR_RENDERER=pixman`): the PowerVR GPU has no open driver |
| OpenCode | Arch's 2.x | the official 1.x ARM release pinned in `os/packaging/fedora/opencode.lock.json`; the skel config is restated in OpenCode 1's `permission` form |
+| Claude Code | installed by hn when first chosen | preinstalled with hn's recipe (`npm install -g @anthropic-ai/claude-code`); version recorded in `/etc/harness-image.json` |
| System profile | `arch` | `debian`: `hn-os` and `harness install/upgrade/rollback` refuse PC system operations, as on Fedora |
| Screen lock | gtklock | not available on Debian 12 (Super+l and the idle lock do nothing yet) |
@@ -54,6 +55,9 @@ NAME`. Sign in with `harness login --qr` and scan from Harness on a phone.
## Checked on hardware
Orange Pi 4 Pro over HDMI (1920×1080): autologin into labwc and `hn`, the daemon after a
-reboot, `hn-browser` opening Chromium maximized, OpenCode answering on Muse Spark 1.3 Free,
-`harness login --qr` rendering on the console. Keyboard shortcuts, audio, suspend and the
-screen lock remain unverified.
+reboot, Super+n (via `screen-action`) opening New Harness, `hn-browser` opening Chromium maximized, OpenCode answering on Muse Spark 1.3 Free,
+`harness login --qr` rendering on the console. Other keyboard shortcuts, audio, suspend and
+the screen lock remain unverified.
+
+The vendor kernel has no `CONFIG_PROC_CHILDREN`, so `screen-action` (every Super shortcut that
+reaches hn) falls back to scanning `/proc` when `/proc/PID/task/TID/children` is missing.
diff --git a/os/platforms/orangepi-4pro/build-image.sh b/os/platforms/orangepi-4pro/build-image.sh
index 943c28ffe..e82497c39 100755
--- a/os/platforms/orangepi-4pro/build-image.sh
+++ b/os/platforms/orangepi-4pro/build-image.sh
@@ -62,15 +62,18 @@ if chroot "$MNT" ldd "$PREFIX/bin/labwc" | grep 'not found'; then
fi
HARNESS_WL_PREFIX=$PREFIX "$HERE/install-session.sh" "$MNT" "$RUNTIME" "$ACCOUNT"
-# OpenCode, the version the ARM package pins; other agents install from hn when chosen.
-chroot "$MNT" su - "$ACCOUNT" -c "npm_config_prefix=\$HOME/.local npm install -g --no-audit --no-fund opencode-ai@$OPENCODE >/dev/null 2>&1"
-python3 - "$MNT/etc/harness-image.json" "$BASE" "$SOURCE" "$OPENCODE" <<'PY'
+# OpenCode, the version the ARM package pins. Claude Code too, by hn's own install recipe
+# (cli/src/lib/engineInstall.ts), so the first Claude harness need not wait for a download;
+# other agents install from hn when chosen.
+chroot "$MNT" su - "$ACCOUNT" -c "npm_config_prefix=\$HOME/.local npm install -g --no-audit --no-fund opencode-ai@$OPENCODE @anthropic-ai/claude-code >/dev/null 2>&1"
+CLAUDE=$(chroot "$MNT" su - "$ACCOUNT" -c '$HOME/.local/bin/claude --version' | cut -d' ' -f1)
+python3 - "$MNT/etc/harness-image.json" "$BASE" "$SOURCE" "$OPENCODE" "$CLAUDE" <<'PY'
import json, subprocess, sys
from pathlib import Path
-path, base, source, opencode = sys.argv[1:]
+path, base, source, opencode, claude = sys.argv[1:]
commit = subprocess.check_output(['git', '-c', f'safe.directory={source}', '-C', source, 'rev-parse', 'HEAD'], text=True).strip()
-Path(path).write_text(json.dumps({'board': 'orangepi4pro', 'base': Path(base).name,
- 'source_commit': commit, 'opencode': opencode}, indent=2) + '\n')
+Path(path).write_text(json.dumps({'board': 'orangepi4pro', 'base': Path(base).name, 'source_commit': commit,
+ 'opencode': opencode, 'claude_code': claude}, indent=2) + '\n')
PY
# Leave no build-host state behind.
diff --git a/os/platforms/orangepi-4pro/install-session.sh b/os/platforms/orangepi-4pro/install-session.sh
index 6e494ebef..d64f57274 100755
--- a/os/platforms/orangepi-4pro/install-session.sh
+++ b/os/platforms/orangepi-4pro/install-session.sh
@@ -66,6 +66,9 @@ EOF
sed -i 's/^%wheel/%sudo/' "$T/etc/sudoers.d/20-harness-network"
# 3. Install the tree. Replace rather than overwrite files a running session may hold open.
+# Connections now live in the CLI; remove the former Python copy from an earlier install.
+rm -rf "$ROOT/usr/lib/harness-os/connections" "$ROOT/usr/share/licenses/harness-os-connections" \
+ "$ROOT/usr/lib/systemd/user/harness-connections.service" "$ROOT/usr/lib/systemd/user/harness-connections.socket"
cp -a --remove-destination "$T/." "$ROOT/"
chmod 440 "$ROOT/etc/sudoers.d/20-harness-network"
# The compositor from build-compositor.sh, at the path the session starts.
diff --git a/os/root/usr/lib/harness-os/screen-action b/os/root/usr/lib/harness-os/screen-action
index 99e23f952..3cbe18745 100755
--- a/os/root/usr/lib/harness-os/screen-action
+++ b/os/root/usr/lib/harness-os/screen-action
@@ -45,7 +45,12 @@ def screen_socket():
owner = process(main) if main > 0 else None
if not owner:
raise RuntimeError('Harness has no active screen.')
- children = (PROC / str(main) / 'task' / str(main) / 'children').read_text().split()
+ try:
+ children = (PROC / str(main) / 'task' / str(main) / 'children').read_text().split()
+ except FileNotFoundError:
+ # CONFIG_PROC_CHILDREN is optional (Orange Pi's vendor kernel lacks it). Every
+ # candidate's parent is checked below, so scanning all processes is equivalent.
+ children = [entry.name for entry in PROC.iterdir() if entry.name.isdigit()]
matches = []
for value in children:
pid = int(value)