Skip to content

feat(agent-sdk): support text step cancel command in ActionWizard - #4006

Open
mehmetkr-31 wants to merge 1 commit into
xmtp:mainfrom
mehmetkr-31:feat/agent-sdk-action-wizard-cancel-command
Open

feat(agent-sdk): support text step cancel command in ActionWizard#4006
mehmetkr-31 wants to merge 1 commit into
xmtp:mainfrom
mehmetkr-31:feat/agent-sdk-action-wizard-cancel-command

Conversation

@mehmetkr-31

@mehmetkr-31 mehmetkr-31 commented Aug 16, 2026

Copy link
Copy Markdown

Summary

Adds support for canceling an active ActionWizard session from free-text steps using a configured command string (e.g. cancel: { command: "/cancel" }).

Previously, ActionWizardCancelOptions only supported button-based cancellation (label) on select steps. During a text step, if a user wished to cancel, typing any text (including /cancel) would be recorded as the answer to that step, leaving users unable to cancel without restarting the wizard via /{id}.

Changes

  • ActionWizard.ts:
    • Extended ActionWizardCancelOptions with optional command?: \/${string}``.
    • Updated middleware to recognize the configured cancel command on text messages and invoke #handleCancel.
  • ActionWizard.test.ts:
    • Added unit test verifying that sending the configured cancel command from a text step successfully terminates the session and calls the cancel handler.

Verification

  • npx eslint agent-sdk/src/middleware/ActionWizard.ts agent-sdk/src/middleware/ActionWizard.test.ts (Clean)
  • GPG signed commit.

Note

Add cancel command support to text steps in ActionWizard

Extends ActionWizardCancelOptions with an optional command field (e.g. '/cancel'). When configured, sending that exact text while a wizard session is active triggers the cancel handler and stops the wizard without advancing to the next step. Previously, cancellation was only possible via a cancel button on select steps.

Macroscope summarized ac7c0c7.

@mehmetkr-31
mehmetkr-31 requested a review from a team as a code owner August 16, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant