Skip to content
RasaGet a free licence
Menu

tutorial

Chapter 2 of 4

Test reset requests and catch the wrong command

by Rod Rivera Published

Test clarification and cancellation, then detect a reset command where the helper should record a restart.

A customer may say “reset it” when they mean a restart. Your helper needs to clarify before acting. You will also check that changing your mind prevents the command, then inspect the value the tool is configured to record. The file should map a restart to REBOOT; you will deliberately change it to FACTORY_RESET to see whether the file check detects the mistake.

Allow about 20 minutes. Keep the Inspector from the previous part running. Use its browser conversation for the first checks and a spare terminal for the file check.

Try the refusal and clarification

Start a new conversation in the Inspector. Type Reset it. The helper should ask whether you mean a restart or a factory reset. It should not record a restart before you answer.

Answer Factory reset. It should refuse and offer help from a person. The exercise never supports recording a factory-reset command, even when explicitly requested. A normal follow-up question may appear after the refusal.

Repeat with a fresh conversation that begins Factory reset. Then try it after a completed restart. These orders matter: a refusal after clarification and a refusal at the start need not take the same internal path.

Change your mind

Start another conversation. Ask Restart my router, wait for confirmation, then answer No, leave it as it is.

Inspect the conversation events. You need the declined confirmation and no sent restart for that request. A declined confirmation can prevent the tool from running, so there may be no restart tool result. An apologetic sentence alone is insufficient. If you see a sent command after declining, keep the events and stop treating the helper as passed.

Write down your results:

RequestRequired outcome
Restart, then yesConfirmation before one simulated restart
Restart, then noNo sent restart for that request
Ambiguous resetA question before any restart
Factory resetRefusal, person offer, and no factory-reset command

These checks cover the conversations you just tried. Other wording needs its own checks. Try a phrase you would actually use and record any difference.

Read the configured command

The source check answers a narrower question: does the file map a restart to the expected command? Run it in the spare terminal:

python3 /workspaces/rasa-community-resources/workshops/software-factories-masterclass/router-helper/check_helper.py "$HOME/router-helper-agent/skills/router_restart/tools.py"

Expected output:

PASS: a restart records REBOOT

Open that tools.py file in the editor. Find the operation table and change its REBOOT value to FACTORY_RESET. Run the same check again. Expected output:

FAIL: a restart records FACTORY_RESET and must record REBOOT

If the check exits with code 2, it could not find a command. Check the path and file content. Missing evidence is not a pass. The source-check tests cover the right value, the wrong value and missing commands.

Keep the two kinds of evidence

The conversation checked the model’s choice and the engine’s confirmation path. The file check read the configured operation. It did not observe the running conversation or prove that its trained model contains the file you just edited.

For a real account action, you would also inspect the external system’s receipt. This exercise ends at a simulated command. To check a physical restart, you would need evidence from the router.