mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 03:37:59 +00:00
Quiet secret store logs and fix untranslated tool messages (#950)
This commit is contained in:
1 parent
88bf475847
commit
aca4404351
6 files changed
+39
-24
No files matched your search
@@ -116,7 +116,7 @@ public sealed class AssistantPluginGenerationService(ToolRegistry toolRegistry,
|
||||
return InitialFailure(TB("The generated assistant metadata does not match the generated plugin."));
|
||||
|
||||
if (this.FindUnknownToolIds(generatedAssistant) is { Count: > 0 } unknownToolIds)
|
||||
return InitialFailure(string.Format(TB("The generated assistant plugin asks for tools this AI Studio does not have: \"{0}\". Please try again."), string.Join(", ", unknownToolIds)));
|
||||
return InitialFailure(string.Format(TB("The generated assistant plugin asks for tools this AI Studio does not have: '{0}'. Please try again."), string.Join(", ", unknownToolIds)));
|
||||
|
||||
return new(true, fullLua, parsedResponse.Plugin?.Name ?? string.Empty, string.Empty);
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public sealed class AssistantPluginGenerationService(ToolRegistry toolRegistry,
|
||||
return RevisionFailure(TB("The revised assistant metadata does not match the revised plugin."));
|
||||
|
||||
if (this.FindUnknownToolIds(revisedAssistant, plugin) is { Count: > 0 } unknownToolIds)
|
||||
return RevisionFailure(string.Format(TB("The revised assistant plugin asks for tools this AI Studio does not have: \"{0}\". Please try again."), string.Join(", ", unknownToolIds)));
|
||||
return RevisionFailure(string.Format(TB("The revised assistant plugin asks for tools this AI Studio does not have: '{0}'. Please try again."), string.Join(", ", unknownToolIds)));
|
||||
|
||||
return new(true, revisedLua, parsedResponse.Plugin?.Name ?? plugin.Name, string.Empty);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,9 @@ public sealed partial class RustService
|
||||
var result = await this.http.PostAsJsonAsync("/secrets/get", secretRequest, this.jsonRustSerializerOptions);
|
||||
if (!result.IsSuccessStatusCode)
|
||||
{
|
||||
if(!isTrying)
|
||||
if(isTrying)
|
||||
this.logger!.LogWarning($"Failed to get the secret data for '{secretKey}' due to an API issue (try mode): '{result.StatusCode}'");
|
||||
else
|
||||
this.logger!.LogError($"Failed to get the secret data for '{secretKey}' due to an API issue: '{result.StatusCode}'");
|
||||
return new RequestedSecret(false, new EncryptedText(string.Empty), TB("Failed to get the secret data due to an API issue."));
|
||||
}
|
||||
@@ -115,8 +117,17 @@ public sealed partial class RustService
|
||||
var state = await result.Content.ReadFromJsonAsync<RequestedSecret>(this.jsonRustSerializerOptions);
|
||||
if (!state.Success)
|
||||
{
|
||||
//
|
||||
// A missing entry is what try mode is for: the absent keyring entry is how the app
|
||||
// recognizes an unconfigured secret in the first place, so it is not worth a line
|
||||
// in the log. Anything else — a locked keychain, an unavailable secret service, a
|
||||
// dismissed prompt — is a real problem that used to hide on debug level:
|
||||
//
|
||||
if (isTrying)
|
||||
this.logger!.LogDebug($"No secret data configured for '{secretKey}' (try mode): '{state.Issue}'");
|
||||
{
|
||||
if (state.IssueCode is not SecretStoreIssueCode.SECRET_NOT_FOUND)
|
||||
this.logger!.LogWarning($"Failed to get the secret data for '{secretKey}' (try mode): '{state.Issue}'");
|
||||
}
|
||||
else
|
||||
this.logger!.LogError($"Failed to get the secret data for '{secretKey}': '{state.Issue}'");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user