Skip to content

Commit ebc9da8

Browse files
committed
fix(build): warn instead of failing when a Resources apiKey is set
The Resources apiKey build guard hard-failed any player build when the committed CoreAISettings asset had a non-empty apiKey. A harmless local placeholder (e.g. the LM Studio key the server ignores) should not block a build, so the guard now logs a warning and continues; a real secret is still flagged in the console so it is not shipped unnoticed. Restored the asset's 'lm-studio' placeholder (cleared in the previous commit only to get past the old hard block). Builds now produce an APK/EXE directly. Bump to 6.1.3.
1 parent 7451efa commit ebc9da8

9 files changed

Lines changed: 27 additions & 17 deletions

File tree

Assets/CoreAI/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [6.1.3] - 2026-07-23
4+
5+
### Changed
6+
7+
- `CoreAIResourcesApiKeyBuildGuard` now **warns instead of failing the build** when a Resources
8+
`CoreAISettings` asset carries a non-empty `apiKey`/`secondaryApiKey`. WHY: a harmless local
9+
placeholder (e.g. an LM Studio key the server ignores) should not hard-block a build; the console
10+
warning still flags a real secret so it is not shipped by accident. The committed asset keeps its
11+
`lm-studio` placeholder and now builds an APK/EXE directly.
12+
313
## [6.1.2] - 2026-07-23
414

515
### Fixed

Assets/CoreAI/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.coreai",
3-
"version": "6.1.2",
3+
"version": "6.1.3",
44
"displayName": "CoreAI",
55
"unity": "6000.0",
66
"description": "Portable C# core for CoreAI \u2014 LLM agents that call your game code. Orchestration, function-calling tools, agent memory, AgentBuilder, SkillSet, and production resilience (retries, timeouts, rate limits), with no UnityEngine dependency. LLM and Lua are optional modules (COREAI_NO_LLM / COREAI_NO_LUA), so the core compiles without them \u2014 install only what your game uses. Unity integration ships in com.neoxider.coreaiunity.",

Assets/CoreAIBenchmark/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.coreaibenchmark",
3-
"version": "6.1.2",
3+
"version": "6.1.3",
44
"displayName": "CoreAI Benchmark",
55
"unity": "6000.0",
66
"description": "LLM game-creation benchmark harness and scenarios for CoreAI: drives execute_lua and world_command through real PlayMode scenarios (G1-G8), grades tool correctness, reasoning, instruction adherence, and determinism, and reports suite/role fitness scores. Depends on com.neoxider.coreai / com.neoxider.coreaiunity / com.neoxider.coreaimods.",

Assets/CoreAIHub/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.coreaihub",
3-
"version": "6.1.2",
3+
"version": "6.1.3",
44
"displayName": "CoreAI Hub (UI Toolkit)",
55
"unity": "6000.0",
66
"description": "Optional UI Toolkit window for CoreAI: a tabbed Hub that renders pages registered into CoreAI's HubPageRegistry (Chat, Settings, Statistics, Mods, and C#/Lua-authored pages). Lazy per-tab content, live tab rebuild on register/unregister, semi-transparent runtime panel, and a future path to Unity 6.5 world-space PanelRenderer. Install this package only when you want the built-in Hub window; without it CoreAI still exposes the registry so you can render pages on your own uGUI/UITK canvas via the API. Depends on com.neoxider.coreai.",

Assets/CoreAIMcp/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.coreaimcp",
3-
"version": "6.1.2",
3+
"version": "6.1.3",
44
"displayName": "CoreAI MCP Server",
55
"unity": "6000.0",
66
"description": "Optional Model Context Protocol (MCP) server that runs INSIDE a live CoreAI game session (play mode or a build) so an external agent - Claude Code and any other MCP client - can drive the running game over a standard protocol. Exposes the in-game Command Bar surface (execute_lua, manage_mods, get_mod_logs, and, when present, world_command + screenshot) as MCP tools over localhost streamable HTTP. Off by default: drop a CoreAiMcpServer component into a scene (or call CoreAiMcpServer.StartServer). Localhost-only, opt-in, no auth - never expose beyond loopback. Depends on com.neoxider.coreaimods; world/screenshot tools register only when those services exist in the current composition.",

Assets/CoreAIMods/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.coreaimods",
3-
"version": "6.1.2",
3+
"version": "6.1.3",
44
"displayName": "CoreAI Mods (Lua)",
55
"unity": "6000.0",
66
"description": "Lua modding layer for CoreAI: the Lua-CSharp sandbox (managed, AOT-safe, WebGL/IL2CPP-ready — bundled, no external package), execute_lua and manage_mods tools, the Lua Modding skill, the mod runtime, persistent mod stores, gameplay bindings, and mod UI. Depends on com.neoxider.coreai / com.neoxider.coreaiunity. Install this package only when you want AI/player-authored Lua mods; without it CoreAI compiles Lua-free.",

Assets/CoreAiUnity/Editor/CoreAIResourcesApiKeyBuildGuard.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
namespace CoreAI.Editor
1010
{
1111
/// <summary>
12-
/// Build-time guard that FAILS the build when a <see cref="CoreAISettingsAsset"/> that ships inside a
13-
/// <c>Resources</c> folder carries a non-empty <c>apiKey</c> or <c>secondaryApiKey</c>.
12+
/// Build-time guard that WARNS (does not fail the build) when a <see cref="CoreAISettingsAsset"/> that
13+
/// ships inside a <c>Resources</c> folder carries a non-empty <c>apiKey</c> or <c>secondaryApiKey</c>.
1414
/// <para>
1515
/// Anything under a <c>Resources/</c> folder is packed into the player and is trivially recoverable from
1616
/// the shipped build (strings are not encrypted). A committed key in such an asset is therefore an
17-
/// exposed secret. Keys must come from environment variables or secure runtime storage and be injected
18-
/// at runtime — never from the committed Resources asset.
17+
/// exposed secret. Prefer environment variables or secure runtime storage and inject the key at runtime.
1918
/// </para>
20-
/// The committed asset is expected to ship with EMPTY keys, so a clean checkout builds fine; this guard
21-
/// only triggers when a key was actually filled in.
19+
/// This is intentionally a warning, not a hard block: a harmless local placeholder (e.g. an LM Studio
20+
/// key the server ignores) should not stop a build. The console warning still flags a real key so it is
21+
/// not shipped by accident.
2222
/// </summary>
2323
public sealed class CoreAIResourcesApiKeyBuildGuard : IPreprocessBuildWithReport
2424
{
@@ -49,12 +49,12 @@ public void OnPreprocessBuild(BuildReport report)
4949
? "apiKey"
5050
: "secondaryApiKey";
5151

52-
throw new BuildFailedException(
52+
Debug.LogWarning(
5353
$"[CoreAI] The CoreAISettings asset at '{path}' lives under a Resources folder and has a " +
5454
$"non-empty {which}. Resources assets are packed into the build and the key is recoverable " +
55-
"from the shipped player. Clear the key on the committed Resources asset and supply it at " +
56-
"runtime from an environment variable or secure storage (e.g. CoreAISettings.Instance / a " +
57-
"local-only config), then rebuild.");
55+
"from the shipped player. If this is a real secret, clear it on the committed Resources asset " +
56+
"and supply it at runtime from an environment variable or secure storage (e.g. " +
57+
"CoreAISettings.Instance / a local-only config). Building anyway.");
5858
}
5959
}
6060

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": "6.1.2",
3+
"version": "6.1.3",
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.",

Assets/Resources/CoreAISettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MonoBehaviour:
1616
executionMode: 2
1717
autoPriority: 0
1818
apiBaseUrl: http://127.0.0.1:1234/v1
19-
apiKey:
19+
apiKey: lm-studio
2020
modelName: qwen3.5-4b-mtp
2121
visionSupport: 0
2222
enableTemperatureOverriding: 1

0 commit comments

Comments
 (0)