Skip to content

Commit 2b32e9d

Browse files
committed
fix(unity): [Inject] на DI-конструкторе AuditLogWriter — VContainer падал на internal string-ctor (5.6.2)
1 parent e40c324 commit 2b32e9d

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

Assets/CoreAiUnity/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ Unity host: **CoreAI.Source** build, EditMode / PlayMode tests, Editor menus, do
44

55
## [Unreleased]
66

7+
## [5.6.2] - 2026-07-12
8+
9+
### Fixed
10+
11+
- **`AuditLogWriter` DI-конструктор помечен `[Inject]`.** VContainer.SourceGenerator выбирал
12+
конструктор с максимумом параметров — `internal AuditLogWriter(string folder)` (тестовый seam) — и
13+
контейнер падал на старте хоста с `VContainerException: No such registration of type: System.String`
14+
(ломался весь `LifetimeScope.Build()` в проектах, вызывающих `RegisterAuditLog()`).
15+
716
### Fixed (2026-07-12 audit wave 2 — host)
817

918
- **LLM request auditing actually works.** The audit interceptor used to resolve before

Assets/CoreAiUnity/Runtime/Source/Features/Audit/AuditLogWriter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using Newtonsoft.Json;
1010
using Newtonsoft.Json.Linq;
1111
using UnityEngine;
12+
using VContainer;
1213

1314
namespace CoreAI.Features.Audit
1415
{
@@ -48,6 +49,9 @@ internal void RotateForTesting()
4849
RotateNow();
4950
}
5051

52+
// WHY [Inject]: без атрибута VContainer.SourceGenerator выбирает конструктор с максимумом
53+
// параметров — internal AuditLogWriter(string) — и падает на резолве System.String.
54+
[Inject]
5155
public AuditLogWriter()
5256
: this(Path.Combine(Application.persistentDataPath, CoreAiPersistentPaths.RootFolderName, "Audit"))
5357
{

Assets/CoreAiUnity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.neoxider.coreaiunity",
3-
"version": "5.6.1",
3+
"version": "5.6.2",
44
"displayName": "CoreAI Unity",
55
"unity": "6000.0",
66
"description": "Unity framework for LLM-powered NPCs and agents that call your game code \u2014 drop-in chat UI, function-calling tools, persistent memory, token-by-token streaming, and per-role LLM routing. Runs on a local GGUF model (via LLMUnity) or any OpenAI-compatible API; proven on a 4 GB local model. Unity layer for com.neoxider.coreai.",

0 commit comments

Comments
 (0)