chore(server): add detail for error (#13151)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Error messages for unavailable copilot providers now include specific
model IDs for clearer context.
* Added new detailed error messages for embedding generation failures
specifying provider and error details.
* The API and GraphQL schema have been extended with new error types
reflecting these detailed error cases.

* **Bug Fixes**
* Enhanced error handling to detect and report incomplete or missing
embeddings from providers.
* Added safeguards to skip embedding insertions when no embeddings are
provided, preventing unnecessary processing.

* **Documentation**
* Updated localization and translation keys to support dynamic error
messages with model IDs and provider details.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2025-07-11 05:55:10 +00:00
committed by GitHub
parent b79439b01d
commit 2052a34d19
13 changed files with 100 additions and 12 deletions
+11 -2
View File
@@ -8706,13 +8706,22 @@ export function useAFFiNEI18N(): {
*/
["error.COPILOT_SESSION_DELETED"](): string;
/**
* `No copilot provider available.`
* `No copilot provider available: {{modelId}}`
*/
["error.NO_COPILOT_PROVIDER_AVAILABLE"](): string;
["error.NO_COPILOT_PROVIDER_AVAILABLE"](options: {
readonly modelId: string;
}): string;
/**
* `Failed to generate text.`
*/
["error.COPILOT_FAILED_TO_GENERATE_TEXT"](): string;
/**
* `Failed to generate embedding with {{provider}}: {{message}}`
*/
["error.COPILOT_FAILED_TO_GENERATE_EMBEDDING"](options: Readonly<{
provider: string;
message: string;
}>): string;
/**
* `Failed to create chat message.`
*/
+2 -1
View File
@@ -2164,8 +2164,9 @@
"error.COPILOT_SESSION_NOT_FOUND": "Copilot session not found.",
"error.COPILOT_SESSION_INVALID_INPUT": "Copilot session input is invalid.",
"error.COPILOT_SESSION_DELETED": "Copilot session has been deleted.",
"error.NO_COPILOT_PROVIDER_AVAILABLE": "No copilot provider available.",
"error.NO_COPILOT_PROVIDER_AVAILABLE": "No copilot provider available: {{modelId}}",
"error.COPILOT_FAILED_TO_GENERATE_TEXT": "Failed to generate text.",
"error.COPILOT_FAILED_TO_GENERATE_EMBEDDING": "Failed to generate embedding with {{provider}}: {{message}}",
"error.COPILOT_FAILED_TO_CREATE_MESSAGE": "Failed to create chat message.",
"error.UNSPLASH_IS_NOT_CONFIGURED": "Unsplash is not configured.",
"error.COPILOT_ACTION_TAKEN": "Action has been taken, no more messages allowed.",