[PR #361] [MERGED] Add structured warning logs for task memory and semantic fallback paths #663

Closed
opened 2026-03-13 21:02:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/361
Author: @AJaySi
Created: 3/2/2026
Status: Merged
Merged: 3/2/2026
Merged by: @AJaySi

Base: mainHead: codex/enhance-logging-in-workflow-and-services


📝 Commits (1)

  • 9d34753 Add structured warning logs for memory and semantic fallback paths

📊 Changes

3 files changed (+56 additions, -8 deletions)

View changed files

📝 backend/api/today_workflow.py (+8 -1)
📝 backend/services/intelligence/monitoring/semantic_dashboard.py (+27 -5)
📝 backend/services/task_memory_service.py (+21 -2)

📄 Description

Motivation

  • Make failure modes observable instead of silently swallowed when task-memory or semantic-generation paths fail.
  • Provide lightweight metrics hooks for degraded semantic filtering to aid monitoring and troubleshooting.
  • Clarify and document fallback behavior in the semantic dashboard so degraded branches emit consistent warnings.

Description

  • In backend/api/today_workflow.py replace the silent except in task outcome recording with a structured logger.warning that includes user_id, task_id, exception class, and exception message.
  • In backend/services/task_memory_service.py add an in-memory metrics store (_metrics_counters) and _increment_metric helper, and replace the broad silent except in the semantic-filter path with increments of semantic_filter_failures and semantic_filter_degraded_path_taken plus a logger.warning that includes user_id, proposal title, exception class, and message.
  • In backend/services/intelligence/monitoring/semantic_dashboard.py remove placeholder no-op branches and add consistent logger.warning messages for skipped/degraded insight-generation branches (missing agent capability, missing dashboard context, or empty ai_insights), and replace a silent alert-persistence failure with a structured warning including error class/message.

Testing

  • Compiled the modified modules with python -m py_compile backend/api/today_workflow.py backend/services/task_memory_service.py backend/services/intelligence/monitoring/semantic_dashboard.py and compilation completed successfully.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/361 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/2/2026 **Status:** ✅ Merged **Merged:** 3/2/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/enhance-logging-in-workflow-and-services` --- ### 📝 Commits (1) - [`9d34753`](https://github.com/AJaySi/ALwrity/commit/9d34753d0fdd04d1803144e598ca5ec2e9d46fe0) Add structured warning logs for memory and semantic fallback paths ### 📊 Changes **3 files changed** (+56 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `backend/api/today_workflow.py` (+8 -1) 📝 `backend/services/intelligence/monitoring/semantic_dashboard.py` (+27 -5) 📝 `backend/services/task_memory_service.py` (+21 -2) </details> ### 📄 Description ### Motivation - Make failure modes observable instead of silently swallowed when task-memory or semantic-generation paths fail. - Provide lightweight metrics hooks for degraded semantic filtering to aid monitoring and troubleshooting. - Clarify and document fallback behavior in the semantic dashboard so degraded branches emit consistent warnings. ### Description - In `backend/api/today_workflow.py` replace the silent `except` in task outcome recording with a structured `logger.warning` that includes `user_id`, `task_id`, exception class, and exception message. - In `backend/services/task_memory_service.py` add an in-memory metrics store (`_metrics_counters`) and `_increment_metric` helper, and replace the broad silent `except` in the semantic-filter path with increments of `semantic_filter_failures` and `semantic_filter_degraded_path_taken` plus a `logger.warning` that includes `user_id`, proposal title, exception class, and message. - In `backend/services/intelligence/monitoring/semantic_dashboard.py` remove placeholder no-op branches and add consistent `logger.warning` messages for skipped/degraded insight-generation branches (missing agent capability, missing dashboard context, or empty `ai_insights`), and replace a silent alert-persistence failure with a structured warning including error class/message. ### Testing - Compiled the modified modules with `python -m py_compile backend/api/today_workflow.py backend/services/task_memory_service.py backend/services/intelligence/monitoring/semantic_dashboard.py` and compilation completed successfully. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69a47b1e4ab883289dddec0ea3d9f8a4) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:02:39 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#663
No description provided.