test: add protocol conformance pins for runtime implementations#987
Merged
Conversation
Typed assignments that make mypy verify each implementation against the protocol surface of the installed uipath-runtime version. A dependency bump that adds or changes protocol members fails typecheck on these lines until the implementations catch up, without this file changing. Covers UiPathLangGraphRuntime, UiPathLangGraphRuntimeFactory and SqliteResumableStorage, wired through UiPathResumableRuntime exactly as in UiPathLangGraphRuntimeFactory._create_runtime_instance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new test module that “pins” protocol conformance for this repo’s uipath-runtime integrations by creating protocol-typed assignment boundaries that mypy can validate against the installed uipath-runtime protocol surfaces.
Changes:
- Introduces protocol-annotated assignments for
UiPathLangGraphRuntime,UiPathLangGraphRuntimeFactory,SqliteResumableStorage, andUiPathResumeTriggerHandlerwiring. - Builds a minimal compiled
StateGraph+ in-memoryAsyncSqliteSavercomposition to reflect the production runtime factory wiring (construction-only).
| value: str | ||
|
|
||
|
|
||
| async def test_langgraph_wiring_satisfies_runtime_protocols() -> None: |
| construction-only: no runtime behavior is exercised here. | ||
| """ | ||
|
|
||
| from typing import TypedDict |
Comment on lines
+45
to
+51
| delegate: UiPathRuntimeProtocol = UiPathLangGraphRuntime( | ||
| graph=compiled_graph, | ||
| runtime_id="protocol-conformance-test", | ||
| entrypoint="test", | ||
| ) | ||
| storage: UiPathResumableStorageProtocol = SqliteResumableStorage(memory) | ||
| trigger_manager: UiPathResumeTriggerProtocol = UiPathResumeTriggerHandler() |
|
radu-mocanu
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Static conformance pins for this repo's
uipath-runtimeprotocol implementations:UiPathLangGraphRuntime,UiPathLangGraphRuntimeFactory, andSqliteResumableStorage, plus the platform'sUiPathResumeTriggerHandleras wired here.Each protocol-annotated assignment is a typed boundary: mypy verifies the implementation against the protocol surface of the installed uipath-runtime version. When a future runtime bump adds or changes protocol members (the uipath-runtime#138 / uipath-python#1764 scenario — the missing
create_triggerscrash originated in this repo's factory wiring), the ordinary mypy job fails on these pre-existing lines, naming the exact class and missing member — no one needs to know about the protocol change in advance.The test mirrors
UiPathLangGraphRuntimeFactory._create_runtime_instancewith real objects (compiled StateGraph, in-memory AsyncSqliteSaver, real trigger handler) flowing intoUiPathResumableRuntime— the exact production composition that broke in the incident, expressed entirely as typed boundaries. Construction-only: no runtime behavior is exercised.Verification
Simulated a protocol change by installing a locally modified uipath-runtime (new
create_triggers_v2member onUiPathResumeTriggerCreatorProtocol): mypy failed on thetrigger_managerpin namingcreate_triggers_v2. Restored to the lockfile: green. Tests pass, mypy and ruff clean.🤖 Generated with Claude Code