test(harness): bot reads PYXIS_TEST_TCP_PORT for its rnsd target (greptile)

The echo bot hardcoded target_port=4242 in its RNS config, but run_e2e.sh bakes
PYXIS_TEST_TCP_PORT into the firmware's TCP target. With a non-default port the
bot kept dialing 127.0.0.1:4242 and silently failed to join the network
(echobot_announce_dest then timed out with a confusing error). Read the port
from the same env var (default 4242) so the bot and T-Deck share one rnsd.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWZuYkHBRqNb6BZHV8sTG5
This commit is contained in:
torlando-agent[bot]
2026-06-19 16:20:46 -04:00
co-authored by Claude Opus 4.8
parent 2ae570f811
commit 7f35ce5eed
+5 -2
View File
@@ -47,6 +47,9 @@ def log(msg):
CONFIG_DIR = "/tmp/echobot-rnsconfig"
STORAGE_DIR = "/tmp/echobot-storage"
DISPLAY_NAME = "Mac Echo Bot"
# rnsd port — must match the one run_e2e.sh bakes into the firmware
# (PYXIS_TEST_TCP_PORT) so the bot and the T-Deck join the same rnsd.
TCP_PORT = os.environ.get("PYXIS_TEST_TCP_PORT", "4242").strip() or "4242"
# Optional: when the harness launches the bot, it sets ECHOBOT_PEER_HEX
# to pyxis's delivery destination hash. We use that to proactively
@@ -84,7 +87,7 @@ os.makedirs(STORAGE_DIR, exist_ok=True)
# Reticulum state). The bot is its own RNS process.
config_path = os.path.join(CONFIG_DIR, "config")
with open(config_path, "w") as f:
f.write("""\
f.write(f"""\
[reticulum]
enable_transport = Yes
share_instance = No
@@ -99,7 +102,7 @@ loglevel = 4
type = TCPClientInterface
enabled = yes
target_host = 127.0.0.1
target_port = 4242
target_port = {TCP_PORT}
""")
reticulum = RNS.Reticulum(configdir=CONFIG_DIR, loglevel=4)