---
id: change/bcapps/10461
type: change
title: "#10461 [SOA] Uptake Agent Task Message Failed status for outbound replies"
summary: Sales Order Agent now marks outbound replies as Failed when they exhaust their retry budget, leveraging a new terminal Failed status from the Agent Runtime instead of application-side state. This prevents failed messages from being re-processed on subsequent agent runs.
tier: official
language: en
tags:
  - feature
  - main
  - bc30
  - page soa email message
  - codeunit soa reply retry mgt.
  - codeunit soa send replies
  - codeunit soa set reply failed
  - codeunit soa upgrade
  - page soa setup
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:07:53.353Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 5bb3a3108b0df5be4ef4634e7d785767a6785544
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10461
    title: "microsoft/BCApps#10461: [SOA] Uptake Agent Task Message Failed status for outbound replies"
    date: "2026-08-21"
    commit: 5bb3a3108b0df5be4ef4634e7d785767a6785544
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/page/4404
    - object/codeunit/4418
    - object/codeunit/4581
    - object/codeunit/4408
    - object/codeunit/4589
    - object/page/4400
    - object/codeunit/4307
    - object/codeunit/4308
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10461
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10461
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-21T15:14:18Z"
author: qasimikram
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "AL: System Application"
  - "Ownership: Needs Review"
  - "Team: Other"
change_class: code
change_kind: feature
behavior_change: true
breaking: false
files:
  count: 8
  additions: 300
  deletions: 62
  al: 8
apps:
  - SalesOrderAgent
  - System Application
objects_touched:
  - key: page/4404
    page: page/4404
    type: page
    id: 4404
    name: SOA Email Message
    app: SalesOrderAgent
    status: modified
  - key: codeunit/4418
    page: codeunit/4418
    type: codeunit
    id: 4418
    name: SOA Reply Retry Mgt.
    app: SalesOrderAgent
    status: modified
  - key: codeunit/4581
    page: codeunit/4581
    type: codeunit
    id: 4581
    name: SOA Send Replies
    app: SalesOrderAgent
    status: modified
  - key: codeunit/4408
    page: codeunit/4408
    type: codeunit
    id: 4408
    name: SOA Set Reply Failed
    app: SalesOrderAgent
    status: added
  - key: codeunit/4589
    page: codeunit/4589
    type: codeunit
    id: 4589
    name: SOA Upgrade
    app: SalesOrderAgent
    status: modified
  - key: page/4400
    page: page/4400
    type: page
    id: 4400
    name: SOA Setup
    app: SalesOrderAgent
    status: modified
  - key: codeunit/4307
    page: codeunit/4307
    type: codeunit
    id: 4307
    name: Agent Message
    app: System Application
    status: modified
  - key: codeunit/4308
    page: codeunit/4308
    type: codeunit
    id: 4308
    name: Agent Message Impl.
    app: System Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 642291
  - 642752
  - 647024
systems:
  - development
  - copilot
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #10461 [SOA] Uptake Agent Task Message Failed status for outbound replies

> Sales Order Agent now marks outbound replies as Failed when they exhaust their retry budget, leveraging a new terminal Failed status from the Agent Runtime instead of application-side state. This prevents failed messages from being re-processed on subsequent agent runs.

[Pull request](https://github.com/microsoft/BCApps/pull/10461) · merged into `main` (BC30) on 2026-08-21 by qasimikram · 8 files (+300 -62), 8 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- Sales Order Agent adopts the Agent Runtime's Failed status: a reply that uses up its retry budget is set to Failed and no longer re-sent or re-logged
- System Application Agent Message adds SetStatusToFailed and SetStatusToReviewed, plus an UpdateStatus overload that writes Status and Status Reason together
- The Failed transition runs in a pre-pass before the send loop, isolated in the new codeunit SOA Set Reply Failed, because errors cannot be trapped after a COMMIT
- The SOA Email Message page shows the real Status and Status Reason, and Retry sending now moves a message from Failed back to Reviewed
- Upgrade code clears leftover attempt rows. The SOA Reply Attempt table is kept as an attempt counter
- Behaviour changes for users or extensions.

## AL objects touched

- [Page 4404 "SOA Email Message"](../../objects/page/4404.md), SalesOrderAgent: modified
- [Codeunit 4418 "SOA Reply Retry Mgt."](../../objects/codeunit/4418.md), SalesOrderAgent: modified
- [Codeunit 4581 "SOA Send Replies"](../../objects/codeunit/4581.md), SalesOrderAgent: modified
- [Codeunit 4408 "SOA Set Reply Failed"](../../objects/codeunit/4408.md), SalesOrderAgent: added
- [Codeunit 4589 "SOA Upgrade"](../../objects/codeunit/4589.md), SalesOrderAgent: modified
- [Page 4400 "SOA Setup"](../../objects/page/4400.md), SalesOrderAgent: modified
- [Codeunit 4307 "Agent Message"](../../objects/codeunit/4307.md), System Application: modified
- [Codeunit 4308 "Agent Message Impl."](../../objects/codeunit/4308.md), System Application: modified

## Context

- Work items: AB#642291, AB#642752, AB#647024
- Labels: AL: Apps (W1), AL: System Application, Ownership: Needs Review, Team: Other
- Systems: development, copilot

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
