Skip to content

Commit 53e4c06

Browse files
Copilotglharper
andauthored
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

1 file changed

+1
-1
lines changed

sdk/ai/ai-projects/src/api/memoryStores/memoryStoreUpdatePoller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export interface CreateMemoryStoreUpdatePollerOptions {
4040
restoreFrom?: string;
4141
}
4242

43-
const terminalUpdateStatuses: MemoryStoreUpdateStatus[] = ["completed", "superseded", "failed"];
43+
const terminalUpdateStatuses: MemoryStoreUpdateStatus[] = ["completed", "superseded"];
4444

4545
function createDefaultUsage(): MemoryStoreOperationUsage {
4646
return {

0 commit comments

Comments
 (0)