Skip to content

feat: add /strands test command for TUI testing#718

Open
Hweinstock wants to merge 21 commits intoaws:mainfrom
Hweinstock:feat/strands-test
Open

feat: add /strands test command for TUI testing#718
Hweinstock wants to merge 21 commits intoaws:mainfrom
Hweinstock:feat/strands-test

Conversation

@Hweinstock
Copy link
Copy Markdown
Contributor

@Hweinstock Hweinstock commented Mar 28, 2026

Description

Adds a /strands test command that uses the existing TUI harness MCP server to drive the CLI interactively and verify behavior on PRs. The Strands agent launches the CLI in pseudo-terminals, interacts with it, verifies expectations, and posts results as PR comments with screenshots of any failures.

How it works

There are two modes: predefined flows, and dynamic flows.

Commenting /strands test {prompt} on a PR will trigger the agent in "tester" mode. If a prompt is specified after the test, it will only run the specified flow (dynamic), otherwise it will run all predefined flows. Results are posted as a PR comment with pass/fail counts and failure screenshots. Successes are also verified with screenshots as artifacts on the GH actions run.

Ex.

/strands test verify that when creating a new project in the TUI, there is a prompt for creating an agent too

--> https://github.com/Hweinstock/agentcore-cli/actions/runs/23949720694
(see attached screenshots, not able to post comment since its running in my fork).

Related Issue

Closes #

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots
    See example run for testing.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

- Add tester mode to process-inputs.cjs (routes /strands test)
- Add task-tester.sop.md with TUI testing instructions
- Add tui-test-flows.md with 5 test flows
- Add Node.js setup + build steps for tester mode in workflow
- Wire TUI harness MCP server (stdio) into the Strands agent
@github-actions github-actions bot removed the size/m PR size: M label Apr 2, 2026
@github-actions github-actions bot added the size/m PR size: M label Apr 2, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Apr 2, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Apr 2, 2026
@github-actions github-actions bot added size/xl PR size: XL and removed size/m PR size: M labels Apr 2, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/xl PR size: XL labels Apr 2, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Apr 2, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Apr 3, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Apr 3, 2026
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Apr 3, 2026
@github-actions github-actions bot removed the size/m PR size: M label Apr 3, 2026
@github-actions github-actions bot added the size/m PR size: M label Apr 3, 2026
Copy link
Copy Markdown
Contributor

@notgitika notgitika left a comment

Choose a reason for hiding this comment

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

Really awesome!

npm install -g "$(npm pack | tail -1)"
mkdir -p /tmp/mcp-harness
cp dist/mcp-harness/index.mjs /tmp/mcp-harness/index.mjs
cd /tmp/mcp-harness && npm init -y && npm install node-pty @xterm/headless express
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.

low risk but can we pin the versions here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are we worried about a breaking change from those packages? I would argue the maintenance burden of pinning and updating isn't worth the tradeoff for consistency.

fetch-depth: 0

- name: Add strands-running label
continue-on-error: true
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.

why this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The runner attempts to add a label to the issue/PR, which doesn't work when running from a fork. Since this step is non-critical, I think its safe to continue if we hit that error.

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

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants