Commit 53e4c06
Fix terminalUpdateStatuses to exclude failed status (#36709)
The `terminalUpdateStatuses` array included "failed", which could cause
failed operations to be incorrectly marked as succeeded if the explicit
failure check was bypassed.
## Change
Removed "failed" from `terminalUpdateStatuses` in
`memoryStoreUpdatePoller.ts`:
```typescript
// Before
const terminalUpdateStatuses: MemoryStoreUpdateStatus[] = ["completed", "superseded", "failed"];
// After
const terminalUpdateStatuses: MemoryStoreUpdateStatus[] = ["completed", "superseded"];
```
## Logic Flow
The `applyUpdateState` function handles statuses in this order:
1. **Lines 111-118**: Explicit "failed" check → sets `state.status =
"failed"`
2. **Lines 121-128**: `terminalUpdateStatuses` check → sets
`state.status = "succeeded"`
3. **Line 131**: Default → sets `state.status = "running"`
With "failed" in `terminalUpdateStatuses`, any logic error allowing
"failed" to reach line 121 would incorrectly mark it as succeeded. This
fix ensures only non-error terminal statuses ("completed", "superseded")
are treated as success.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/Azure/azure-sdk-for-js/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: glharper <[email protected]>1 parent d1b2cc5 commit 53e4c06
File tree
1 file changed
+1
-1
lines changed- sdk/ai/ai-projects/src/api/memoryStores
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments