원클릭으로
testing-mastracode-tui
// Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers.
// Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers.
| name | testing-mastracode-tui |
| description | Testing mastracode TUI features interactively in Konsole. Covers model configuration, thread lifecycle, task state isolation, and common blockers. |
Guide for interactive testing of mastracode's terminal UI in Konsole.
OPENROUTER_API_KEY — for using OpenRouter as a custom provider when Anthropic/OpenAI keys are unavailableBuild mastracode and its dependencies:
cd /home/ubuntu/repos/mastra
COREPACK_ENABLE_STRICT=0 pnpm build:mastracode
This may take a few minutes. If pnpm has corepack issues, install directly: npm install -g pnpm@10.11.0
If the build fails due to pre-existing DTS errors in @mastra/core or @mastra/memory, use --continue to let downstream packages (including mastracode) still build:
COREPACK_ENABLE_STRICT=0 pnpm turbo build --filter ./mastracode --continue
If unit tests fail with missing @mastra/core/workspace, run pnpm build:core first.
If you don't have a direct Anthropic/OpenAI API key, configure OpenRouter as a custom provider:
Edit ~/.local/share/mastracode/settings.json:
{
"customProviders": [
{
"name": "OpenRouter",
"url": "https://openrouter.ai/api/v1",
"apiKey": "<OPENROUTER_API_KEY value>",
"models": ["minimax/minimax-m2.7"]
}
],
"models": {
"activeModelPackId": "custom:Custom",
"modeDefaults": {
"build": "openrouter/minimax/minimax-m2.7",
"plan": "openrouter/minimax/minimax-m2.7",
"fast": "openrouter/minimax/minimax-m2.7"
}
},
"customModelPacks": [
{
"name": "Custom",
"models": {
"build": "openrouter/minimax/minimax-m2.7",
"plan": "openrouter/minimax/minimax-m2.7",
"fast": "openrouter/minimax/minimax-m2.7"
},
"createdAt": "2026-01-01T00:00:00.000Z"
}
]
}
After launching mastracode, you may also need to activate the custom pack via /models → select "Custom" → "Activate".
Verify the status bar at the bottom shows the correct model (e.g., build openrouter/minimax/minimax-m2.7).
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.
| Command | Action |
|---|---|
/new | Create a new empty thread |
/threads | Open thread selector (↑↓ navigate, Enter select) |
/clone | Clone current thread |
/models | Switch model pack |
/help | Show all available commands |
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:
cd /home/ubuntu/repos/mastra/mastracode
npx tsx test-script.ts
Key approach:
UserMessageComponent from ./src/tui/components/user-message.js)Spacer components when measuringThis approach catches bugs that are hard to see visually and provides concrete pass/fail evidence.
The key scenario for thread state testing:
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"
Verify tasks visible: Look for the "Tasks [0/N completed]" section with ○/▶/✓ icons between the status line and the editor input.
Test /new: The task progress component should completely disappear. The screen should show only "Ready for new conversation" and an empty input.
Test /threads switch: Switch back to the original thread — messages and tasks should restore correctly.
Test /clone: Cloned threads should start with empty tasks (tasks are ephemeral, not persisted to clones).
GOOGLE_GENERATIVE_AI_API_KEY for the OM model. Fix this by setting the OM model to an OpenRouter model via /om or in settings.json (models.omModelOverride). Configure the OM model if you expect observation to trigger during testing./models in the TUI to activate the custom pack.pnpm cli fails with module resolution errors, run pnpm build:mastracode (or with --continue) from the repo root to build all transitive dependencies.cd /home/ubuntu/repos/mastra
COREPACK_ENABLE_STRICT=0 pnpm --filter mastracode exec vitest run src/tui/__tests__/
Some pre-existing test failures may exist in the broader test suite — focus on tests relevant to the feature being verified.
Use early when debugging a medium or hard bug, especially when tests alone may not reveal the real runtime failure. Trigger this before extended TDD iteration when a bug involves runtime state, ordering, persistence, streaming, concurrency, UI/manual reproduction, external services, or when a red or newly passing test may not model the real issue. Skip only when the root cause is already directly proven by a stack trace or deterministic test that exercises the real runtime path.
Smoke test the Agent Builder feature branch end-to-end against a hermetic project scaffolded by the skill (linked to the current worktree). Covers workspace reconciliation, stored agents/skills CRUD, ownership, visibility, stars, registry/library Copy flow, picker allowlists, model policy, RBAC role gating, role impersonation UI, builder defaults, infrastructure diagnostics, channels, and Studio + Agent Builder UI. Trigger when validating the agent-builder feature branch, PRs that touch packages/server, packages/playground, packages/playground-ui agent-builder routes, or builder EE code paths.
Use when creating an approachable, self-contained HTML review aid for a pull request; explaining what changed, why it matters, how it works, and how it fits into the broader system; turning PR diffs, commits, tests, and architecture context into a local `.pr-review/` HTML page for reviewers; or helping reviewers understand complex code changes without dumping the full diff.
Use when breaking a large, complex, messy, or hard-to-review pull request into multiple smaller PRs; planning stacked PRs; extracting independent changes from a branch; splitting mixed refactor and behavior changes; managing drift after review feedback; rebasing follow-up PRs as earlier PRs change; or preserving original branch intent while shipping incrementally.
Smoke test Mastra projects locally or deploy to staging/production. Tests Studio UI, agents, tools, workflows, traces, memory, and more. Supports both local development and cloud deployments.
Documentation guidelines for Mastra. This skill should be used when writing or editing documentation for Mastra. Triggers on tasks involving documentation creation or updates.