Build a Tetris extension for a terminal arcade (TypeScript, Pi)
Session from pi-extensions-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk
Click a segment to jump to that moment
37msession
2interventions
GOAL
Round out an existing terminal arcade (snake, space invaders, ping) by adding a Tetris extension for the Pi coding agent, install it, and get it working properly.
- +0Prompt · +0We have /snake, /space-invaders, /ping. What are we missing? Probably tetris.
- +0mAgent did · +0mInvestigated existing extensions (ping.ts pattern), wrote tetris.ts (677 lines) with tetrominoes, ghost piece, hold, DAS, updated README and long-task-harness feature tracking, committed alongside an already-uncommitted pacman.ts.
- +3mPrompt · +3mCan you install it for me
- +3mAgent did · +3mUpdated ~/.pi/agent/settings.json to register the tetris extension, noted snake was already installed elsewhere.
- +4mIntervention · +4mReported the blocks couldn't be controlled and asked the agent to plan its approach before fixing.Why: I couldn't move any pieces so I wanted the agent to actually diagnose the input handling rather than guess.
- +4mAgent did · +4mCompared against ping.ts and found tetris.ts used the wrong method name (onKey instead of handleInput) and an unsupported onKeyUp; rewrote input handling and committed the fix.
- +10mIntervention · +10mAsked for movement to be one cell per keypress instead of the DAS auto-repeat behaviour.Why: DAS didn't make sense without key-release detection, so I wanted plain single-step movement instead.
- +10mAgent did · +10mRemoved DAS/auto-repeat state and logic, made each keypress move one cell, committed the change.
- +20mFail · +20mHitting space caused instant game over, and without it pieces never reached the bottom - traced to isValidPosition rejecting pieces spawning above row 0.
- +37mOutcome · +37mTetris finalized, committed and pushed 10 commits to origin/main; progress/feature tracking files updated in a follow-up commit; agent confirmed long-task-harness hooks were already installed.
VERDICT
Next time I'd ask the agent to check the existing games' input-handling pattern (handleInput vs onKey) before writing a new extension from scratch, since that mismatch caused the controls to be broken initially. Telling it to 'plan your approach' before fixing the input bug was what got it to actually diff against ping.ts instead of guessing, and that's what found both the method name bug and the DAS/spawn-zone issues quickly.