Skip to content

fix(llm): log exception of response json decoding#13004

Open
ChristophWurst wants to merge 1 commit into
mainfrom
fix/llm/log-json-decode-exception
Open

fix(llm): log exception of response json decoding#13004
ChristophWurst wants to merge 1 commit into
mainfrom
fix/llm/log-json-decode-exception

Conversation

@ChristophWurst
Copy link
Copy Markdown
Member

@ChristophWurst ChristophWurst commented Jun 1, 2026

Ref #12538

Summary by CodeRabbit

  • Chores
    • Improved error logging for AI integration event processing to capture detailed failure information for better debugging and system monitoring.

@ChristophWurst
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds diagnostic logging to the AI integrations service when JSON decoding of event data fails. When a JsonException occurs in generateEventData(), a warning log is now emitted with the exception message, exception object, and threadId before returning null.

Changes

AI Integration Error Diagnostics

Layer / File(s) Summary
JSON decoding error logging
lib/Service/AiIntegrations/AiIntegrationsService.php
When JsonException occurs during event-data decoding, the service logs a warning with the exception message, exception object, and threadId for improved observability.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A little log to catch the light,
When JSON's parsing runs not right,
With thread and message, clear and bright,
We'll spot the issues in the night! 📝✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: adding exception logging for JSON decoding failures in the LLM integration service.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/llm/log-json-decode-exception

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/Service/AiIntegrations/AiIntegrationsService.php (1)

6-8: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Update SPDX header to the required policy format

This file’s SPDX header does not match the required repository policy (AGPL-3.0-only and older copyright years).

Suggested patch
-/**
- * SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-only
- */
+/*
+ * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */

As per coding guidelines, "**/*.{php,js,ts,tsx,vue}: Every file must include an SPDX license header. New files must use 'AGPL-3.0-or-later', never 'AGPL-3.0-only'. Header format: /* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */".


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b6f39e06-0d68-4e55-b739-7546938d80fa

📥 Commits

Reviewing files that changed from the base of the PR and between e77bff6 and 5d3432a.

📒 Files selected for processing (1)
  • lib/Service/AiIntegrations/AiIntegrationsService.php

Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
@ChristophWurst ChristophWurst force-pushed the fix/llm/log-json-decode-exception branch from 5d3432a to 7557fc0 Compare June 3, 2026 08:25
@ChristophWurst
Copy link
Copy Markdown
Member Author

/backport to stable5.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant