Repository navigation
fix(llm): register LlmChatRunner in LLMAgent worker DI - #391
Merged
Merged
Conversation
LlmServiceProxy resolves LlmChatRunner in its constructor, but the worker's manual DI list was not updated when the five provider services were deleted in the LLM rewrite. Every agent task therefore killed the worker process with an unhandled InvalidOperationException (exit code 0xE0434352) and the chat session stalled until heartbeat-timeout recovery. - Add LlmProviderRegistry + LlmChatRunner (singleton, same as the main process DI scan) to LLMAgentProgram.BuildServices - Add regression test resolving IAgentTaskExecutor, which constructs LlmServiceProxy and would have caught the missing registration
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
PR Check ReportSummary
Test Results
Code Quality
Test Artifacts
LinksThis report is auto-generated by GitHub Actions |
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.
Symptom
Production log (2026-09-16) shows the agent worker process dying as soon as it picked up a task:
Every LLM chat in agent-process mode was dead until recovery, and recovery could not succeed either.
Root cause
The Phase 4.5 rewrite replaced the five provider services with
LlmChatRunner, andLlmServiceProxywas updated to resolve it:The worker builds its own DI container manually (
LLMAgentProgram.BuildServices) and was only updated for the renamed provider-API classes (OpenAiModelApi…), not for the newly introducedLlmChatRunner/LlmProviderRegistry. Constructing the executor therefore throwsand because
AgentLoopService.ProcessTaskAsyncresolves the executor outside itstry, the exception escapesRunAsyncand kills the worker process.CI stayed green because the only worker-DI test asserted that
ResponsesModelApistill resolves.Fix
LlmProviderRegistryandLlmChatRunner(singletons, matching the main-process DI scan lifetimes) inLLMAgentProgram.BuildServices.BuildServices_RegistersAgentTaskExecutor, which resolvesIAgentTaskExecutor(constructsLlmServiceProxy→LlmChatRunner). Fails before the fix, passes after.Validation
dotnet build TelegramSearchBot.sln -c Release→ 0 errorsdotnet test TelegramSearchBot.LLM.Test→ 267/267 passeddotnet test TelegramSearchBot.Test→ 445 passed, 1 skipped (pre-existing skip)