Skip to content

Fix Durable user-summary extraction race (#40), add Function-app import guard (#39), and remove dead vector-dedup scaffolding - #41

Merged
Aayush Kataria (aayush3011) merged 3 commits into
AzureCosmosDB:mainfrom
aayush3011:users/akataria/searchIssueFix
Aug 17, 2026
Merged

Fix Durable user-summary extraction race (#40), add Function-app import guard (#39), and remove dead vector-dedup scaffolding#41
Aayush Kataria (aayush3011) merged 3 commits into
AzureCosmosDB:mainfrom
aayush3011:users/akataria/searchIssueFix

Conversation

@aayush3011

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 17, 2026 20:59

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.

Pull request overview

This PR removes now-unreferenced vector distance/dedup helper code from the pipeline layer and its supporting utilities/tests, and updates integration-test docstrings to reflect the simplified retrieval behavior.

Changes:

  • Deleted unused vector-distance policy helpers from PipelineService and AsyncPipelineService and dropped their related imports.
  • Removed vector_order_direction / distance_function_from_container_properties from _utils and deleted their unit tests.
  • Updated integration-test helper docstrings to no longer reference the removed internal _vector_candidates behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/test_utils.py Removes unit tests and imports for deleted _utils helpers.
tests/integration/test_full_pipeline.py Updates docstring wording for vector-search gating helper.
tests/integration/test_async_full_pipeline.py Updates docstring wording for async vector-search gating helper.
azure/cosmos/agent_memory/services/pipeline.py Removes unused vector distance/dedup helper methods and related imports.
azure/cosmos/agent_memory/aio/services/pipeline.py Removes unused async vector distance/dedup helper methods and related imports.
azure/cosmos/agent_memory/_utils.py Removes unused vector distance helper functions/constants.

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

@aayush3011 Aayush Kataria (aayush3011) changed the title Removing some unused code Fix Durable user-summary extraction race (#40), add Function-app import guard (#39), and remove dead vector-dedup scaffolding Aug 17, 2026

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (1)

function_app/orchestrators/user_summary.py:61

  • The wait-loop can exceed the configured USER_SUMMARY_WAIT_SECONDS budget: when now < deadline but now + poll_interval > deadline, the timer is currently scheduled past the deadline, so the orchestrator may wait longer than intended before deciding to give up. Also, reading context.current_utc_datetime multiple times per iteration makes the logic harder to reason about and test (and can drift if the value changes between reads). Consider capturing now once per iteration and capping the timer fire-at to deadline.
    while isinstance(user_summary, dict) and user_summary.get("status") == _NO_MEMORIES_YET_STATUS:
        if context.current_utc_datetime >= deadline:
            logger.warning(
                "UserSummary no memories persisted within %ss for user=%s; skipping this "
                "cadence (a later user-summary threshold will retry)",
                wait_budget,
                user_id,
            )
            return {"persisted": False, "user_summary_id": None, "skipped": _NO_MEMORIES_YET_STATUS}
        yield context.create_timer(context.current_utc_datetime + timedelta(seconds=poll_interval))
        user_summary = yield context.call_activity_with_retry("us_Extract", retry, extract_payload)

@aayush3011
Aayush Kataria (aayush3011) merged commit 04e0b2e into AzureCosmosDB:main Aug 17, 2026
8 checks passed
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