Skip to content

feat(context-grounding): let agents opt in to searching an ingesting index - #1891

Open
CalebMartinUiPath wants to merge 1 commit into
mainfrom
caleb/allow-search-during-ingestion
Open

feat(context-grounding): let agents opt in to searching an ingesting index#1891
CalebMartinUiPath wants to merge 1 commit into
mainfrom
caleb/allow-search-during-ingestion

Conversation

@CalebMartinUiPath

@CalebMartinUiPath CalebMartinUiPath commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Why

Searching a context index while it was ingesting raised IngestionInProgressException unconditionally, so an agent pointed at an index that was still ingesting failed outright instead of retrieving the documents already indexed. ECS serves partial results during ingestion, but there was no way to ask for them.

What

An opt-in flag rather than dropping the guard, so the default stays the current fail-fast behaviour and the choice can surface as a toggle in the agent designer.

uipath-platformunified_search and unified_search_async take search_during_ingestion: bool = False and only raise when it is False. Also documented the arg and the Raises: contract, which neither had.

uipathAgentContextSettings gains search_during_ingestion (alias searchDuringIngestion, default False): the agent.json field the UI writes.

The CLI context-grounding search command exposes it as --search-during-ingestion, which the SDK/CLI alignment contract test requires.

The consumer side lands in UiPath/uipath-langchain-python#1075, which is blocked on this releasing.

Scope

Only the unified search paths. The deprecated search / search_async, and start_deep_rag / start_batch_transform, keep their unconditional guards.

Sync unified_search never had the guard its async twin did, which looks like an oversight. It now blocks by default like its async counterpart. This is a behaviour change for anyone relying on sync unified search against an ingesting index — they should pass search_during_ingestion=True.

Backward compatibility

An agent.json predating the toggle reads as False, i.e. exactly today's behaviour. Verified end to end, not just at the model layer.

Worth knowing for the UI work: BaseCfg sets extra="allow", so a new agent.json loaded by an old SDK silently accepts and ignores the key — the toggle just does nothing, with no error. The version pins here are what prevent that.

Testing

  • 10 new tests in uipath-platform: 6 assert blocking-by-default (both ingestion statuses, sync and async), 4 assert the opt-in works.
  • 5 new tests in uipath covering the default, alias and field-name parsing, and round-trip.
  • Each new test was negative-checked: reverted the change, confirmed it fails, restored.
  • Full suites green. ruff check, ruff format and mypy clean in both packages.
  • Ran check_version_uniqueness.py and check_dependency_version_bumps.py locally; both pass.

Versions: uipath-platform 0.2.28 → 0.2.29, uipath 2.14.13 → 2.14.14 (plus its platform pin), lockfiles regenerated.

🤖 Generated with Claude Code

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.

🟡 Changes recommended

Update the shipped SDK reference and add synchronous opt-in test coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds opt-in searching of partially ingested context indexes while preserving fail-fast defaults.

Changes:

  • Adds search_during_ingestion to unified sync/async search.
  • Exposes the setting through AgentContextSettings.
  • Updates tests, package versions, dependencies, and lockfiles.
File summaries
File Summary
packages/uipath/uv.lock Updates locked dependencies.
packages/uipath/tests/agent/models/test_agent.py Tests setting parsing and serialization.
packages/uipath/src/uipath/agent/models/agent.py Adds the agent configuration field and alias.
packages/uipath/pyproject.toml Bumps package version and platform dependency.
packages/uipath-platform/uv.lock Updates locked platform dependencies.
packages/uipath-platform/tests/services/test_context_grounding_service.py Tests ingestion blocking and async opt-in; synchronous opt-in coverage remains missing for both statuses (nit, 1 vote).
packages/uipath-platform/src/uipath/platform/context_grounding/_context_grounding_service.py Implements opt-in behavior; the shipped SDK reference still omits the new signatures (critical, 3 votes).
packages/uipath-platform/pyproject.toml Bumps the platform package version.
Review details

Suppressed comments (3)

packages/uipath-platform/src/uipath/platform/context_grounding/_context_grounding_service.py:1672

  • The synchronous opt-in branch is not covered: the new tests exercise unified_search(..., search_during_ingestion=True) only for the async method, while the sync tests cover only the default blocking path. Add a synchronous opt-in case (ideally alongside the existing parametrized async case) so the advertised sync API cannot regress independently.
        search_during_ingestion: bool = False,

packages/uipath-platform/src/uipath/platform/context_grounding/_context_grounding_service.py:1672

  • This new SDK parameter is not in the CLI command and is not listed in SDK_EXCLUSIONS for the context-grounding search contract (packages/uipath/tests/cli/contract/test_sdk_cli_alignment.py:197-201). The alignment test compares the method signature directly, so it will fail on search_during_ingestion; either expose and forward a CLI option or explicitly exclude this SDK-only parameter.
        search_during_ingestion: bool = False,

packages/uipath-platform/tests/services/test_context_grounding_service.py:3916

  • The synchronous opt-in path is not covered by the added tests: search_during_ingestion=True is exercised only for unified_search_async, while unified_search is tested only for the default rejection. Please add the equivalent synchronous opt-in cases for both Queued and InProgress so a regression in this newly added branch cannot pass the suite.
    @pytest.mark.anyio
    @pytest.mark.parametrize("ingestion_status", ["Queued", "InProgress"])
    async def test_unified_search_async_opt_in_searches_during_ingestion(
  • Files reviewed: 6/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

folder_key: Optional[str] = None,
folder_path: Optional[str] = None,
include_system_indexes: bool = False,
search_during_ingestion: bool = False,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 3c011bc.

SDK_REFERENCE.md and CLI_REFERENCE.md now carry the new parameter:

  • unified_search / unified_search_async signatures gain search_during_ingestion: bool=False
  • the CLI reference lists --search-during-ingestion

One deliberate deviation from "regenerate": running scripts/update_agents_md.py in full produces +232/-24 lines, because the committed copy has drifted since 2026-06-16 and is missing unrelated surface from other PRs (38 entities methods, 7 governance, plus tasks/processes/mcp). Rather than attribute that churn to a context-grounding PR, I hand-applied only the three lines belonging to this change — then re-ran the generator and diffed to confirm my lines are byte-identical to what it emits, so the next just build won't move them.

The remaining drift is worth a separate regeneration PR.

@CalebMartinUiPath
CalebMartinUiPath force-pushed the caleb/allow-search-during-ingestion branch from 7b27a51 to cabc442 Compare September 9, 2026 23:26
…index

Searching a context index while it was ingesting raised
IngestionInProgressException unconditionally, so an agent pointed at an
index that was still ingesting failed outright instead of retrieving the
documents already indexed. ECS serves partial results during ingestion,
but there was no way to ask for them.

Add an opt-in flag rather than dropping the guard, so the default stays
the current fail-fast behaviour and the choice can surface as a toggle in
the agent designer:

- unified_search and unified_search_async take search_during_ingestion
  (default False) and only raise when it is False.
- AgentContextSettings gains searchDuringIngestion (default False), the
  agent.json field the UI writes.
- The CLI search command exposes it as --search-during-ingestion, keeping
  the SDK/CLI alignment contract satisfied.

Sync unified_search never had the guard its async twin did, which looks
like an oversight; it now blocks by default like its async counterpart.
This is a behaviour change for callers relying on sync unified search
against an ingesting index, who should now pass
search_during_ingestion=True.

The deprecated search and search_async, along with start_deep_rag and
start_batch_transform, keep their unconditional guards.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CalebMartinUiPath
CalebMartinUiPath force-pushed the caleb/allow-search-during-ingestion branch from cabc442 to 3c011bc Compare September 9, 2026 23:48
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants