Skip to content

feat(cli): Add optional Snake game to the init waiting screen - #1432

Open
sergical wants to merge 4 commits into
mainfrom
feat/cli-init-snake
Open

sergical wants to merge 4 commits into
mainfrom
feat/cli-init-snake

Conversation

@sergical

@sergical sergical commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

sentry init waits a long time on the remote setup workflow. This PR adds an optional Snake game to the waiting screen. Press g to play.

  • The game engine (snake-game.ts) is pure state plus a half-block renderer. Each tick re-renders only the board.
  • A prompt, a new warning or error, or the end of the run closes the game and pauses it.
  • SENTRY_INIT_GAME=0 hides the game. It is also hidden when an AI agent runs the CLI.
  • The pane is measured with useBoxMetrics. A resize pauses the run and keeps it.
  • pnpm --filter sentry run proto:snake runs the UI against a fake, offline workflow.

Breaking Changes

  • None

sergical and others added 2 commits October 6, 2026 18:14
`sentry init` spends a long time waiting on the remote setup workflow.
While it waits, a small box invites the user to press `g` and play Snake
in the activity pane. The setup spinner and progress sidebar stay
visible.

The game yields the pane when the wizard needs attention: a prompt, a
new warning or error, or the end of the run closes the board and pauses
the game, and the invite then offers to resume. Game state lives outside
WizardStore so each tick re-renders only the board, which is drawn as a
single half-block string.

`pnpm --filter sentry run proto:snake` drives the real Ink UI through a
fake, offline workflow for local testing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hide the waiting-screen game with SENTRY_INIT_GAME=0 and when an AI
agent runs the CLI. Measure the game pane with useBoxMetrics instead of
calculating it from the frame layout. A terminal resize now keeps the
run, pauses it, and moves the snake inside the new board. The run starts
over only when the snake cannot fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sergical
sergical marked this pull request as ready for review October 6, 2026 22:28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 6, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4521f2f. Configure here.

Comment thread packages/cli/src/lib/init/ui/ink-snake.tsx
Esc paused the run only in the board's unmount effect, after the invite
had rendered, so the invite kept the play copy. Pause before closing.

Ink writes no intermediate frames when it detects CI, so the live snake
tests read an empty frame there. Force interactive mode in those tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant