Skip to content

Python: Update canonical document status after restored upload retries - #9085

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ktz03:fix/cu-restored-upload-status
Oct 12, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ktz03:fix/cu-restored-upload-status

Conversation

@ktz03

Copy link
Copy Markdown
Contributor

Motivation & Context

A pending Content Understanding vector-store upload retains a second reference to its document entry. Restoring the session reconstructs separate mappings, so a later upload success or failure leaves the canonical document and list_documents stuck at uploading after the queue is cleared.

Description & Review Guide

  • What are the major changes? Resolve each pending upload to the current document entry before retrying. Add regressions for restored success/failure, timeout followed by another restore, and the existing in-memory and orphan-entry controls.
  • What is the impact of these changes? The document status, upload duration, and failure details reflect the completed retry after restoration. Existing upload/timeout/cleanup behavior and the fallback for a missing document key are preserved; no public API or state format changes.
  • What do you want reviewers to focus on? Preservation of the canonical document reference and the existing fallback. Six focused cases reproduce three failures before the fix and all pass afterward. On Windows/Python 3.12.14, the package non-integration suite passed 87 tests with five integration tests excluded (88.70% coverage); source Pyright, all five test type checkers, Ruff, changed-file hooks, and wheel/sdist builds passed. Offline SDK lifecycle checks also covered JSON/MessagePack file-store restoration with an explicitly registered DocumentStatus codec. The existing unconfigured-codec rejection and compatible to_dict() warnings remain unchanged. No live Azure upload, authentication, indexing, or model run was performed.

Related Issue

Fixes #9084

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 20:50

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.

Copilot review overview

🟢 Approval recommended

The targeted fix preserves fallback behavior and has comprehensive regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes restored upload retries so they update the canonical document state.

Changes:

  • Resolves queued uploads against the current document mapping.
  • Adds six regression cases covering success, failure, timeout, restoration, and fallback behavior.
File Description
_context_provider.py Uses the canonical document entry during retries.
test_context_provider.py Adds focused retry and restoration tests.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Merged via the queue into microsoft:main with commit 34e980a Oct 12, 2026
52 of 53 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 4e14f060 Deployed Oct 9, 2026 by ktz03 via team_check #6421
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Restored Content Understanding upload retries leave document status stale

3 participants