Labsco
mastra-ai logo

testing-mastracode-tui

β˜… 25,800

by mastra-ai Β· part of mastra-ai/mastra

Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers.

πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup
πŸ”’ Repo-maintenance skill. It exists to help maintain mastra-ai/mastra itself β€” it's only useful if you contribute code to that project.

Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers.

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates β€” shown here so you can audit it before installing. You don't need to read it to use the skill.


name: testing-mastracode-tui description: Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers.

Testing Mastracode TUI

Guide for interactive testing of mastracode's terminal UI in Konsole.

Devin Secrets Needed

  • OPENROUTER_API_KEY β€” for using OpenRouter as a custom provider when Anthropic/OpenAI keys are unavailable

Launching Mastracode

Copy & paste β€” that's it
cd /home/ubuntu/repos/mastra/mastracode
COREPACK_ENABLE_STRICT=0 pnpm cli

On first launch, mastracode may show a setup wizard. Select "Skip" to proceed to the main TUI without configuring models interactively.

Key TUI Commands

CommandAction
/newCreate a new empty thread
/threadsOpen thread selector (↑↓ navigate, Enter select)
/cloneClone current thread
/modelsSwitch model pack
/helpShow all available commands

Programmatic Rendering Tests

For visual/rendering bugs (e.g., border alignment, padding, wrapping), writing a quick tsx script that directly renders the component is more reliable than visual inspection alone:

Copy & paste β€” that's it
cd /home/ubuntu/repos/mastra/mastracode
npx tsx test-script.ts

Key approach:

  • Import the component directly (e.g., UserMessageComponent from ./src/tui/components/user-message.js)
  • Render at specific widths and strip ANSI codes to measure visible character widths
  • Assert all lines have identical visible width (for bordered components)
  • Test at multiple terminal widths (40, 60, 80, 100, 120+) to catch edge cases
  • Filter out trailing empty lines from Spacer components when measuring
  • For before/after comparisons, simulate the old logic inline to confirm the bug exists

This approach catches bugs that are hard to see visually and provides concrete pass/fail evidence.

Testing Thread State Isolation

The key scenario for thread state testing:

  1. Generate tasks: Ask the model to use the task_write tool explicitly. Some models (e.g., minimax) may not call it automatically β€” you may need to say something like: "Please use the task_write tool to create a task list with 3 items: Fix login bug, Add unit tests, Update docs"

  2. Verify tasks visible: Look for the "Tasks [0/N completed]" section with β—‹/β–Ά/βœ“ icons between the status line and the editor input.

  3. Test /new: The task progress component should completely disappear. The screen should show only "Ready for new conversation" and an empty input.

  4. Test /threads switch: Switch back to the original thread β€” messages and tasks should restore correctly.

  5. Test /clone: Cloned threads should start with empty tasks (tasks are ephemeral, not persisted to clones).