fix: multi-bug sprint across settings, insights, energy, jobs, diagnostics#65
Merged
fix: multi-bug sprint across settings, insights, energy, jobs, diagnostics#65
Conversation
…stics - Fix InsightType enum mismatch: replace _enum_column(String) with postgresql.ENUM(create_type=False) so SQLAlchemy emits correct type casts for insighttype/insightstatus/insightimpact columns - Energy tariff: add server-side period fallback using TARIFF_SCHEDULE when HA entity is missing; fall back to period rate when current is 0 - Energy sensors: filter out aggregate/accumulative sensors in ConsumptionSummary (by entity_id pattern and source attribute) - Diagnostics error log: align summary shape (add errors/warnings from counts_by_level); map known_patterns to frontend-expected fields - Diagnostics traces: enrich response with run_name, job_type, title - Jobs: persist descriptive titles as MLflow tag ha.job_title; prefer tag over formatted run_name; fix filter-before-sort with overfetch - Activity panel: add onClick navigation to /jobs on job rows - Settings: sync AppSettingsResponse type; use setQueryData for immediate cache update; add inline error display for mutations Made-with: Cursor
Defines the guided automation builder agent feature that wires Feature 36's existing automation builder workflow into the system as a dedicated agent with chat preset, orchestrator routing, and step-by-step progress in the activity panel. Made-with: Cursor
Cover connection/auth, subscribe, event dispatch, exponential backoff reconnection (doubling, ceiling), backoff reset on successful connect, start_task lifecycle, stop/cancel, and non-event message filtering. Made-with: Cursor
Cover event queuing, per-entity debounce, batch upsert data shape, DB error recovery (restore pending), automation state triggering proposal sync, stats tracking, and flush-on-stop. Made-with: Cursor
Cover threshold filtering (all impact levels), quiet hours (same-day, midnight-crossing), batch vs single notification, disabled state, from_settings factory with DB and fallback, send failure graceful return, and _parse_time helper. Made-with: Cursor
Add NotificationForm with enabled toggle, min_impact dropdown, quiet hours start/end time inputs. Widen SettingsValue type to include string for notification preferences. Grid expanded to 4 columns to accommodate new tab. Made-with: Cursor
Add optimization.jobHistory() client function with status/limit params, useJobHistory() React Query hook, and optimization.history query key for F38 job history UI. Made-with: Cursor
Add expandable Job History section with status filter dropdown and clickable rows showing status badge, truncated job ID, date, and insight/suggestion counts. Selecting a row loads it as the active job in the existing detail card. Made-with: Cursor
Apply contextlib.suppress, sort imports, add type annotations for context manager functions, and use cast for SimpleNamespace duck-typed Insight objects. Made-with: Cursor
The Insight entity declares insighttype, insightimpact, and insightstatus with create_type=False (managed by Alembic). Integration tests use Base.metadata.create_all which skips enum creation, causing "type does not exist" errors. Create the enum types explicitly before table creation. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_enum_column(String(255))withpostgresql.ENUM(..., create_type=False)fortype,status, andimpactcolumns on theinsightstable, fixing theDatatypeMismatchErrorthat broke optimisations/analysisTARIFF_SCHEDULE+ local time; fall back to period-specific rate whencurrent_rateis 0; filter out aggregate/accumulative sensors fromConsumptionSummaryerrors/warningsfields); mapknown_patternsto frontend-expected fields; enrich traces withrun_name,job_type,titleha.job_title; prefer tag in_map_trace_to_job; fix filter-before-sort by overfetching whenjob_typeis specifiedonClicknavigation to/jobson job list rowsAppSettingsResponseto includenotifications; usesetQueryDatafor immediate cache update on mutation; add inline error displayTest plan
test_tariff_tools,test_log_parser,test_error_patterns,test_dal_insights,test_api_settings,test_api_jobs,test_diagnostics_api,test_insight_model,test_dal_app_settings)/jobsMade with Cursor