Skip to content

docs: redesign test subcommand as headless mode#46

Merged
Pertempto merged 25 commits intomainfrom
spec/007-test-subcommand-http-redesign
Jan 12, 2026
Merged

docs: redesign test subcommand as headless mode#46
Pertempto merged 25 commits intomainfrom
spec/007-test-subcommand-http-redesign

Conversation

@Pertempto
Copy link
Contributor

@Pertempto Pertempto commented Jan 8, 2026

I had shelley implement the test subcommand, but it turned out to actually be a bit inconvenient for the agent to access the image files from the temporary directory.

It works much better if we just scrap the temporary directory output and the stdin/stdout system. Instead just serve headless mode through a simple HTTP server.

I also found a better name to describe what this actually is - headless rather than test.

Key changes:
- HTTP server on port 8080 instead of stdin/stdout JSON
- POST /input returns both render_url and raw ANSI
- GET /render/latest.png for easy browser viewing
- GET /render/{timestamp}.png for specific renders
- Larger default terminal size (120x30)
- just recipes for starting test server
'headless' better describes running the TUI without a terminal,
which is the standard term (like headless browsers).
@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

specs/007-headless-subcommand.md — The API returns a raw ansi string in the POST response. Please specify whether this is the full ANSI stream or the visible cell grid (ANSI normalized). Recommend returning both: a normalized text grid (no cursor/OSC/VT control sequences) for easy text assertions, and the raw ANSI when needed for debugging.

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Changes Requested

  • Bind the HTTP server to localhost by default and add an explicit --bind/--host flag to expose publicly. Document CORS/auth expectations.
  • Add a configurable render retention policy (max renders or TTL) or document why unbounded retention is acceptable.
  • Clarify what the returned ansi value represents; prefer returning both a normalized text grid and the raw ANSI stream.

Summary of Changes

  • New spec specs/007-headless-subcommand.md introducing a headless subcommand that starts an HTTP server to accept input commands and serve PNG renders and ANSI output.
  • Removes the prior test subcommand spec (specs/007-test-subcommand.md), replacing it with the headless design and updated API.

Overall Feedback

  • The move from a filesystem/stdin approach to an HTTP server is reasonable and will be more convenient for agents and debugging, but the current spec omits important operational/security details (binding, CORS, auth). Please address those to avoid accidental exposure.
  • The design covers useful features (POST /input, render URLs, ANSI) and sensible defaults; once the operational/security options and render retention/response normalization are specified, this will be a solid foundation for headless testing.

Please update the spec with the requested changes and ping me when ready for another review.

Thanks! 🎯

@Pertempto Pertempto changed the title docs: redesign test subcommand as headless subcommand docs: redesign test subcommand as headless mode Jan 8, 2026
- Fix terminal size references to 160x40
- Add task for error responses on invalid actions
- Clarify initial render happens on startup
- Clarify input recipe wraps curl
- Bind to localhost (127.0.0.1) by default
- Add --bind flag to optionally expose to network
- Document lack of authentication and CORS
- Note that server is for local dev/testing only
- Add --max-renders flag (default: 100) to prevent unbounded memory growth
- Implement FIFO eviction when limit reached
- Clarify that ansi field contains raw View() output with all escape sequences
@Pertempto
Copy link
Contributor Author

Wow! surprisingly on-point feedback for the code review bot!

@Pertempto Pertempto marked this pull request as ready for review January 8, 2026 18:44
@Pertempto Pertempto self-assigned this Jan 8, 2026
@Pertempto Pertempto requested a review from bambam955 January 8, 2026 18:44
Reduced verbosity while keeping all essential information:
- Problem section removed (context is clear)
- Usage examples consolidated
- Design decisions summarized
- Task list unchanged
- Add backticks around all endpoint references
- Unify GET /state and POST /input response formats
- Update creation date to January 8
- Must use FiraCode Nerd Font for powerline symbol support
- Add task for configuring bubbletea ANSI output to non-tty
@Pertempto

This comment was marked as resolved.

Address clarifying questions from implementation:
- Key format uses tea.KeyMsg.String() (enter, esc, ctrl+c, etc.)
- Mode values from CurrentMode.Name (list, start, help, stats)
- Timestamp format with all dashes for URL safety
- Link to Ghostty source for color palette reference
- Add full 16-color palette table with hex values
- Specify pure black (#000000) as default/background color
- Remove external Ghostty reference
@Pertempto
Copy link
Contributor Author

I did a quick test with fresh Shelley agent. Here were the clarifying questions that should be better addressed in the spec.

addressed with two newest commits

@Pertempto Pertempto mentioned this pull request Jan 8, 2026
7 tasks
@Pertempto Pertempto merged commit bcda246 into main Jan 12, 2026
1 check passed
@Pertempto Pertempto deleted the spec/007-test-subcommand-http-redesign branch January 12, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants