Public: anyone can read this; the crew can change it.

A game box's sync is never refused for terminal colours: the forge cleans machine output, and the agent sends it plain #17279

opened this

Merged 34h 4m ago, live in production

Production box mc's syncs have been refused with 400 since its servers started (22:18Z). The JSON was valid, but refuseDirtyJson refuses any control character, and real Minecraft and itzg logs carry ANSI colour escapes (\u001b). So the forge's view froze.

Notes

opened this

Production box mc's syncs have been refused with 400 since its servers started (22:18Z). The JSON was valid, but refuseDirtyJson refuses any control character, and real Minecraft and itzg logs carry ANSI colour escapes (\u001b). So the forge's view froze.

  • Forge: the sync route reads with boundedMachineBody. cleanJson strips terminal escapes and control characters from machine output (log lines, command output); input from people elsewhere is still refused as before. A body that is genuinely not JSON logs the box, the reason and its first 200 bytes. This unfreezes mc with no change on the box.
  • Agent: every string is walked plain, every part is checked with jq -e (with a fallback), and the body goes through a file with curl --data-binary @file (one exec argument is capped at 128 KB, which would wedge a box with long logs).
  • test/game-sync-plain.test.ts: real-shaped docker output (a stats warning line, blank ps lines, ANSI, BEL, 0xA7), an old-agent body accepted and cleaned, invalid JSON logged.

Tests not run locally (the Mac is kept free); the forge's runners check it.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs