Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d70500c
fix: unify registry endpoint policy
VIUK-XV Aug 21, 2026
6a77262
fix: select auxiliary models per role
VIUK-XV Aug 21, 2026
2cc6bba
fix: make Persona thread deletion durable
VIUK-XV Aug 21, 2026
5f52166
fix: keep Persona index lightweight
VIUK-XV Aug 21, 2026
7825832
fix: enforce safety soften rewrite contract
VIUK-XV Aug 21, 2026
6dc6145
fix: preserve Persona safety rating snapshots
VIUK-XV Aug 21, 2026
139a6c5
fix: apply age policy to all active story cast
VIUK-XV Aug 21, 2026
73a9d3a
fix: resolve Story provider before legacy model branch
VIUK-XV Aug 21, 2026
de61673
fix: recover Persona threads missing from index
VIUK-XV Aug 21, 2026
61f67fc
fix: detect safety domains in output checks
VIUK-XV Aug 21, 2026
12bbd03
fix: keep Advanced Persona provider boundary strict
VIUK-XV Aug 21, 2026
7688b01
fix: make Simple AI routes fallback chains
VIUK-XV Aug 21, 2026
e96921e
fix: encode lightweight Persona index entries
VIUK-XV Aug 21, 2026
48da2e4
fix: resolve AI configuration compile issues
VIUK-XV Aug 21, 2026
acb8a9d
test: disambiguate model tuning roles
VIUK-XV Aug 21, 2026
1aa3b01
fix: connect production safety pipeline to local model
VIUK-XV Aug 21, 2026
683508d
fix: align Character Library metadata with age policy
VIUK-XV Aug 21, 2026
476162c
fix: gate Story Library by age availability
VIUK-XV Aug 21, 2026
58da4f3
fix: gate Story character picker by age policy
VIUK-XV Aug 21, 2026
e139cb0
fix: classify Story and Character safety ratings
VIUK-XV Aug 21, 2026
7c98558
fix: keep model preferences consistent with registry
VIUK-XV Aug 21, 2026
e6eca2c
fix: lock Persona continuations by age policy
VIUK-XV Aug 21, 2026
e2051d0
fix: bind Local registry models to artifacts
VIUK-XV Aug 21, 2026
c3be514
fix: purge missing model preference references
VIUK-XV Aug 21, 2026
52e373e
fix: preserve failed UserProfile persistence
VIUK-XV Aug 21, 2026
1af45d6
fix: expose migration failures and preserve staging
VIUK-XV Aug 21, 2026
68be25c
fix: compact Character deletion markers
VIUK-XV Aug 21, 2026
a8148bd
fix: preserve AI and migration failure context
VIUK-XV Aug 21, 2026
10219c7
fix: surface profile and registry save failures
VIUK-XV Aug 21, 2026
3c94c98
fix: refresh copied UI text after language changes
VIUK-XV Aug 21, 2026
35ed697
fix: make profile reset and migration diagnostics transactional
VIUK-XV Aug 21, 2026
151dd6f
fix: keep deletion marker storage actor-safe
VIUK-XV Aug 21, 2026
c0ba880
fix: protect local runtime and auxiliary routing
VIUK-XV Aug 21, 2026
5b33389
fix: require digests for custom model sources
VIUK-XV Aug 21, 2026
7bbaed3
fix: enforce Persona registry route contracts
VIUK-XV Aug 21, 2026
60ef5d6
fix: use platform-safe Persona export writes
VIUK-XV Aug 21, 2026
4c9911d
fix: isolate persisted text from prompt instructions
VIUK-XV Aug 21, 2026
96adc4b
fix: redact local runtime diagnostics
VIUK-XV Aug 21, 2026
6ad8d0d
fix: keep prompt safety boundaries within local budget
VIUK-XV Aug 21, 2026
4761b7d
test: align navigation smoke with continuation tab
VIUK-XV Aug 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions KizunaAI/AI/AIExecutionModes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ enum AIProviderError: LocalizedError, Equatable {
case configurationDisabled
case missingCredential
case invalidEndpoint
case localArtifactUnavailable(String)
case httpStatus(Int, String)
case invalidResponse
case emptyResponse
Expand All @@ -1153,6 +1154,8 @@ enum AIProviderError: LocalizedError, Equatable {
return "The selected AI provider credential is not configured."
case .invalidEndpoint:
return "The selected AI provider endpoint is invalid."
case let .localArtifactUnavailable(artifactID):
return "The selected local model artifact is unavailable: \(artifactID)."
case let .httpStatus(status, body):
let preview = String(body.prefix(180))
return preview.isEmpty ? "AI provider request failed with HTTP \(status)." : "AI provider request failed with HTTP \(status): \(preview)"
Expand Down Expand Up @@ -1213,6 +1216,9 @@ final class AIModelRouter {
guard let configuration = registry.configuration(id: configurationID) else {
throw AIProviderError.invalidResponse
}
if let role, !configuration.roles.contains(role) {
throw AIProviderError.noProviderForRole(role)
}
guard configuration.isEnabled else {
throw AIProviderError.configurationDisabled
}
Expand All @@ -1231,7 +1237,11 @@ final class AIModelRouter {
preferredConfigurationID: UUID? = nil,
allowsFallback: Bool = true
) async throws -> AIGenerationResponse {
var configurations = registry.configurations(for: role)
var configurations = tuningStore.orderedConfigurationsForCurrentMode(
for: role,
configurations: registry.configurations(for: role),
fallbackProviderID: nil
)
let storedPreferredConfigurationID = preferredConfigurationID
?? tuningStore.configurationIDForCurrentMode(
for: role,
Expand Down Expand Up @@ -1293,9 +1303,14 @@ private final class LocalAIProvider: AIProvider {
request: AIGenerationRequest,
configuration: AIModelConfiguration
) async throws -> AIGenerationResponse {
let selectedModelURL = LocalAssistantModelManager.shared.modelURL(
let modelManager = LocalAssistantModelManager.shared
let selectedModelURL = modelManager.modelURL(
forArtifactID: configuration.identity.artifactID
)
if let artifactID = configuration.identity.artifactID,
selectedModelURL == nil {
throw AIProviderError.localArtifactUnavailable(artifactID)
}
let result = await LocalAssistantRuntimeBridge.shared.generateReply(
prompt: request.userPrompt,
contextPrompt: nil,
Expand Down Expand Up @@ -1323,7 +1338,7 @@ private final class LocalAIProvider: AIProvider {
.split(separator: "/")
.last
.map(String.init)
let artifactID = observedArtifactID ?? configuration.identity.artifactID
let artifactID = configuration.identity.artifactID ?? observedArtifactID
let identity = AIModelIdentity(
providerID: .localRuntime,
modelID: configuration.identity.modelID,
Expand Down
Loading