Skip to content

feat: add interactive callback CLI#8486

Merged
valerena merged 1 commit into
aws:developfrom
bchampp:feat/interactive-callback-cli
Dec 3, 2025
Merged

feat: add interactive callback CLI#8486
valerena merged 1 commit into
aws:developfrom
bchampp:feat/interactive-callback-cli

Conversation

@bchampp

@bchampp bchampp commented Dec 3, 2025

Copy link
Copy Markdown
Member

Which issue(s) does this change fix?

Why is this change necessary?

Customers using sam local invoke to test durable functions that are using callback operations need a way to know when their functions are suspended and waiting for a callback. Otherwise, the only other way to know is by querying the execution history (sam local execution history) and seeing a CallbackStarted and InvocationCompleted event. This is not the best user experience, and we should be prompting users to respond to pending callbacks immediately.

How does it address the issue?

This PR adds a callback handler which will prompt users to respond to pending callbacks. The prompts include success, fail, heartbeat or stopping the execution entirely. We create a new thread in the polling loop to prompt the user, so we can continue checking the execution state and history. If another process resolves the callback (e.g. you call sam local callback succeed from another session), the execution will continue.

What side effects does this change have?

None. Improved UX for callbacks in the local invoke loop.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bchampp
bchampp requested a review from a team as a code owner December 3, 2025 08:11
@github-actions github-actions Bot added area/local/start-api sam local start-api command area/local/invoke sam local invoke command area/local/start-invoke pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Dec 3, 2025
Comment thread samcli/lib/utils/durable_callback_handler.py
@valerena
valerena added this pull request to the merge queue Dec 3, 2025
Merged via the queue into aws:develop with commit f30d12b Dec 3, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/local/invoke sam local invoke command area/local/start-api sam local start-api command area/local/start-invoke pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants