Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

The memory store update poller was not initializing state.result when operations failed, creating inconsistency with successful terminal states and potential issues for consumers expecting a defined result.

Changes

  • Initialize state.result with default value in failed state (empty operations array, zero usage) matching the pattern used for succeeded/superseded states
if (parsed.status === "failed") {
  state.status = "failed";
  if (!state.error) {
    state.error = parsed.error
      ? new Error(parsed.error.message ?? "Memory update failed")
      : new Error("Memory update failed");
  }
  // Initialize result with default value for consistency, even on failure
  state.result = parsed.result ??
    state.result ?? {
      memory_operations: [],
      usage: createDefaultUsage(),
    };
  return;
}

This ensures state.result is always defined in terminal states, preventing undefined access when processResult casts state.result as MemoryStoreUpdateResult.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Address feedback on LRO poller for memory ops update Initialize state.result in failed LRO operations Nov 20, 2025
Copilot AI requested a review from glharper November 20, 2025 21:58
Copilot finished work on behalf of glharper November 20, 2025 21:58
@glharper glharper marked this pull request as ready for review November 21, 2025 00:45
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