跳到正文
cccskills
免费在 GitHub 公开

testing-mastracode-tui

Test mastracode’s terminal interface in Konsole, covering model setup, conversation switching, task state isolation, and display issues. The guide combines interactive checks with scripted rendering tests and troubleshooting steps for common build and configuration problems.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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

集成工具OpenAI
查看安装方法

适用场景

  • Checking task state when switching conversations
  • Setting up OpenRouter for interactive tests
  • Testing borders and wrapping at different terminal widths
  • Troubleshooting build and model configuration issues

包含的文件(1)

  • SKILL.md6.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

Prerequisites

  1. Build 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

  2. 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
    
  3. If unit tests fail with missing @mastra/core/workspace, run pnpm build:core first.

Configuring a Custom Provider (OpenRouter)

If you don't have a direct Anthropic/OpenAI API key, configure OpenRouter as a custom provider:

  1. 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"
        }
      ]
    }
    
  2. After launching mastracode, you may also need to activate the custom pack via /models → select "Custom" → "Activate".

  3. Verify the status bar at the bottom shows the correct model (e.g., build openrouter/minimax/minimax-m2.7).

Launching Mastracode

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:

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).

Common Issues

  • Observational memory errors: You may see errors about 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.
  • Model not calling tools: Less capable models may not use mastracode's tool system. Explicitly instruct them to use specific tools by name.
  • Status bar shows wrong model: After changing settings.json, you may need to use /models in the TUI to activate the custom pack.
  • Build failures: If pnpm cli fails with module resolution errors, run pnpm build:mastracode (or with --continue) from the repo root to build all transitive dependencies.
  • User message rendering without LLM: The user message box renders immediately on Enter, before any LLM response. You can test rendering bugs without a working LLM connection — just submit a message and inspect the bordered box.

Running Unit Tests

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.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Design and audit an agent's system prompt, the instructions that guide its work. Define a concrete outcome, starting input, available tools, completion checks, fallback behavior, and final report so the prompt describes a complete run.

中文简介正在准备中。当前显示英语简介。

  • Designing the core instructions for a new agent
  • Auditing a prompt before saving it
  • Defining behavior when tools or permissions are missing
mastra-ai/mastra2.9万2026年10月22日 更新

Create a dedicated test project linked to the current worktree and check Agent Builder through APIs and browser interactions. It covers agent and skill management, permissions, defaults, and related features, with selectable test sections.

中文简介正在准备中。当前显示英语简介。

  • Validate an Agent Builder feature branch before review
  • Check role-based permissions and authentication
  • Test agent and skill management through APIs and the UI
mastra-ai/mastra2.9万2026年10月22日 更新

Reviews pull requests for bugs, error handling, code quality, and style consistency. Organizes feedback into an overview, must-fix issues with file locations, improvement suggestions, and positive notes so reviewers can distinguish urgent problems from refinements.

中文简介正在准备中。当前显示英语简介。

  • Finding bugs that must be fixed before merging
  • Reviewing TypeScript types and asynchronous code
  • Checking naming, imports, and leftover debug statements
mastra-ai/mastra2.9万2026年10月22日 更新

Design instructions for agents that write, fix, review, or refactor code. Define behavior based on file access, select suitable tools, and set clear verification and completion rules for repository changes or copyable code output.

中文简介正在准备中。当前显示英语简介。

  • Designing an agent for repository bug fixes
  • Defining a pull request review agent
  • Creating a code generator without workspace access
mastra-ai/mastra2.9万2026年10月22日 更新

Configure Factory board behavior and GitHub or Linear event handlers in deployment code. Adjust stage transitions, phase meanings, and tool-result handling, then check the changes with focused tests and versioned audit records.

中文简介正在准备中。当前显示英语简介。

  • Add approval requirements to board transitions
  • Change GitHub or Linear event handling
  • Define custom board phases and tool-result rules
mastra-ai/mastra2.9万2026年10月22日 更新

Design agents that draft blog posts, social posts, newsletters, and marketing copy. Define the audience, brand voice, length, and required output so each agent delivers a complete draft with a headline and supporting notes.

中文简介正在准备中。当前显示英语简介。

  • Build a blog writing agent with a consistent brand voice
  • Design an agent for LinkedIn product posts
  • Define delivery rules for newsletter drafts
mastra-ai/mastra2.9万2026年10月22日 更新

查看 mastra-ai 的全部技能

报告此技能的问题