fix: apply connection binding overwrite to BYO model resolution - #126
Merged
Merged
Conversation
andreiancuta-uipath
requested review from
DragosBobolea,
cosminacho,
cristipufu,
dragosvelcea,
ionmincu,
ionut-mihalache-uipath,
radu-mocanu and
vldcmp-uipath
as code owners
August 13, 2026 15:26
andreiancuta-uipath
had a problem deploying
to
LLMGW_SETTINGS
August 13, 2026 15:27 — with
GitHub Actions
Failure
Solution-deployed BYOM agents fail at startup with "Model <name> not found" listing that same model: the package carries the design-time connection id while the job's resource overwrites carry the connection actually bound in the target folder. get_model_info filters discovery entries by byomDetails.integrationServiceConnectionId against the stale id and matches nothing. Decorate the two places byo_connection_id is consumed — the discovery lookup and the ByoIsConnectionId routing header. Every entry point inherits the remap: get_chat_model, direct chat model construction, and embeddings. Callers that forward a design-time id no longer have to apply the binding themselves. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
andreiancuta-uipath
force-pushed
the
fix/byo-connection-binding-overwrite
branch
from
August 13, 2026 15:50
7f9c13d to
e523880
Compare
andreiancuta-uipath
had a problem deploying
to
LLMGW_SETTINGS
August 13, 2026 15:51 — with
GitHub Actions
Failure
ionut-mihalache-uipath
approved these changes
Aug 13, 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.
Problem
Binding overwrite for model connection id (enabled for a few customers that need models scoped to folders) was not applied. This means that both lookup and completions used the original, in-project id. This can lead to the discovery lookup not matching the model, because it was looking for the wrong connection id.
The same stale id also reaches the gateway as
X-UiPath-LlmGateway-ByoIsConnectionId, so even a successful lookup would route against the wrong connection.Fix
Apply the active
connection.<id>overwrite at the two points wherebyo_connection_idis consumed:UiPathBaseSettings.get_model_infoget_chat_model,get_embedding_model, andUiPathBaseLLMClient.setup_model_infobuild_routing_headersX-UiPath-LlmGateway-ByoIsConnectionId— both the sync and asyncUiPathHttpxClientEvery entry point inherits the remap: the factory functions, direct
UiPathChat(...)/ embeddings construction, and callers layered above them.resource_overrideis a no-op when no overwrites are active, so local and non-BYOM runs are unchanged.This mirrors
BindingsOverwriter.ApplyAgentSettingsOverwriteson the C# side. The legacy in-repo clients (uipath-langchain) carry the decorator on their__init__, which fixed the header but never the lookup, because the legacy factory resolves the model before constructing the client — the same ordering trap one layer up.CI
The
Testjob is red, but no test failed. The session collects 3164 items and reaches[100%]with noForEin the progress output, and the log has noFAILEDline and no short test summary. pytest then crashes inpytest_sessionfinishwhile writing the warnings summary:The runner's stdout pipe is non-blocking, so a full buffer returns
EAGAINinstead of blocking. The warnings summary is large enough to fill it:langchain_testsmarks its sync tests with a class-level@pytest.mark.asyncio, emitting one longPytestWarningper parametrized model/provider combination. The unhandled error propagates out of the hook and pytest exits 1.Unrelated branches hit the same crash (run 31717075787), and the same commit flips between pass and fail across re-runs. Fix tracked in a separate PR — silencing the warning via
filterwarningsinpyproject.toml.🤖 Generated with Claude Code