feat(context-grounding): let agents opt in to searching an ingesting index - #1891
feat(context-grounding): let agents opt in to searching an ingesting index#1891CalebMartinUiPath wants to merge 1 commit into
Conversation
b8a3e46 to
7b27a51
Compare
There was a problem hiding this comment.
🟡 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_ingestionto 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_EXCLUSIONSfor 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 onsearch_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=Trueis exercised only forunified_search_async, whileunified_searchis tested only for the default rejection. Please add the equivalent synchronous opt-in cases for bothQueuedandInProgressso 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, |
There was a problem hiding this comment.
Good catch — fixed in 3c011bc.
SDK_REFERENCE.md and CLI_REFERENCE.md now carry the new parameter:
unified_search/unified_search_asyncsignatures gainsearch_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.
7b27a51 to
cabc442
Compare
…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>
cabc442 to
3c011bc
Compare
|



Why
Searching a context index while it was ingesting raised
IngestionInProgressExceptionunconditionally, 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-platform—unified_searchandunified_search_asynctakesearch_during_ingestion: bool = Falseand only raise when it isFalse. Also documented the arg and theRaises:contract, which neither had.uipath—AgentContextSettingsgainssearch_during_ingestion(aliassearchDuringIngestion, defaultFalse): theagent.jsonfield the UI writes.The CLI
context-grounding searchcommand 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, andstart_deep_rag/start_batch_transform, keep their unconditional guards.Sync
unified_searchnever 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 passsearch_during_ingestion=True.Backward compatibility
An
agent.jsonpredating the toggle reads asFalse, i.e. exactly today's behaviour. Verified end to end, not just at the model layer.Worth knowing for the UI work:
BaseCfgsetsextra="allow", so a newagent.jsonloaded 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
uipath-platform: 6 assert blocking-by-default (both ingestion statuses, sync and async), 4 assert the opt-in works.uipathcovering the default, alias and field-name parsing, and round-trip.ruff check,ruff formatandmypyclean in both packages.check_version_uniqueness.pyandcheck_dependency_version_bumps.pylocally; both pass.Versions:
uipath-platform0.2.28 → 0.2.29,uipath2.14.13 → 2.14.14 (plus its platform pin), lockfiles regenerated.🤖 Generated with Claude Code