Skip to content

Routines Autopilot Sample - #1159

Open
Kelly (lykelly19) wants to merge 2 commits into
mainfrom
routines-autopilot
Open

Kelly (lykelly19) wants to merge 2 commits into
mainfrom
routines-autopilot

Conversation

@lykelly19

Copy link
Copy Markdown

No description provided.

Copilot AI balanced review requested due to automatic review settings November 11, 2026 17:02

Copilot AI left a comment

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.

🟡 Changes recommended

Stop requests can leave reminders enabled because overdue timers are excluded from the stop path and concurrent turns allow a later stop to overtake an earlier scheduling request.

3 open issues
What changed in this PR

Adds a Routines Autopilot sample that turns personal Teams messages into timers and recurring reminders using the Foundry Routines API.

Changes:

  • Adds model-based request interpretation, routine lifecycle management, status queries, and reminder delivery.
  • Provides deployment configuration and provisioning scripts to create or reuse Azure resources.
  • Documents setup, publication, safety limits, and operational verification.
File Description
samples/​python/​autopilot-agents/​routines/​scripts/​prepare-resources.ps1 Selects and validates Azure resources and model deployments.
samples/​python/​autopilot-agents/​routines/​scripts/​prepare-provision.ps1 Invokes the sample’s provisioning helper.
samples/​python/​autopilot-agents/​routines/​requirements.txt Pins hosted runtime dependencies.
samples/​python/​autopilot-agents/​routines/​README.md Documents behavior, deployment, safety, and troubleshooting.
samples/​python/​autopilot-agents/​routines/​pyproject.toml Defines package dependencies and the command entry point.
samples/​python/​autopilot-agents/​routines/​main.py Provides the hosted runtime entry point.
samples/​python/​autopilot-agents/​routines/​infra/​modules/​foundry.bicep Creates new Foundry resources while referencing reused resources.
samples/​python/​autopilot-agents/​routines/​infra/​main.parameters.json Maps environment settings to infrastructure parameters.
samples/​python/​autopilot-agents/​routines/​infra/​main.bicep Coordinates resource provisioning and deployment outputs.
samples/​python/​autopilot-agents/​routines/​azure.yaml Configures hosting, publication, environment settings, and hooks.
samples/​python/​autopilot-agents/​routines/​agent/​routines.py Implements scoped ownership checks and routine lifecycle operations.
samples/​python/​autopilot-agents/​routines/​agent/​app.py Interprets requests and handles scheduling, status, stopping, and delivery.
samples/​python/​autopilot-agents/​routines/​agent/​activity_routing.py Routes supported Teams messages and routine delivery events.
samples/​python/​autopilot-agents/​routines/​agent/​__main__.py Enables module-based startup.
samples/​python/​autopilot-agents/​routines/​agent/​__init__.py Initializes the agent package.
samples/​python/​autopilot-agents/​routines/​.gitignore Excludes local environments, caches, and configuration.
samples/​python/​autopilot-agents/​routines/​.agentignore Excludes development and provisioning files from deployment.
samples/​python/​autopilot-agents/​README.md Adds Routines to the Autopilot sample catalog.

Review effort: Balanced

Comment on lines +476 to +478
elif enabled is True and (
candidate.schedule.at is None or candidate.schedule.at > observed_at
):
Copilot AI balanced review requested due to automatic review settings November 11, 2026 21:28

Copilot AI left a comment

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.

🔵 Needs a closer look

The routine lifecycle lacks automated safety tests, and reminder send failures are swallowed rather than surfaced for failure reporting or reconciliation.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Surface unconfirmed routine deliveries without blindly retrying

samples/​python/​autopilot-agents/​routines/​agent/​app.py:435

Routine-delivery events also use this helper, so a send timeout or transport error is swallowed and the delivery handler returns normally without confirmed delivery. Separate best-effort conversational replies from reminder delivery, and surface unconfirmed deliveries through the host's failure-reporting or reconciliation path. The application error handler must preserve that failure without sending a generic chat reply or blindly retrying an ambiguous send.

Medium severity Add lifecycle tests for malformed records and ambiguous commit outcomes

samples/​python/​autopilot-agents/​routines/​agent/​routines.py:339

The new routine lifecycle has no automated tests, although comparable lifecycle safety is tested in meeting-assistant/tests/test_meeting_lifecycle.py. Add offline tests for foreign or malformed records, multiple active routines, re-enabling an identical disabled routine, and create/enable/disable operations that commit but time out. Assert outcomes and mutation counts for matching, missing, and conflicting readbacks so reconciliation cannot silently repeat a mutation or report an unconfirmed success.

2 resolved since last review

Review effort: Balanced

This branch was successfully deployed

1 active deployment
L4-validation — e0d8ff18 Deployed Nov 11, 2026 by lykelly19 via trusted #950
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.

2 participants