fix: lazy-load ChiefOfStaff, async pathExists, accessibility labels, hook stability#133
fix: lazy-load ChiefOfStaff, async pathExists, accessibility labels, hook stability#133
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves reliability and maintainability across server routes/services and several client pages by standardizing async error handling, surfacing previously swallowed errors, and replacing scattered magic numbers with named constants. It also updates some UI flows to update local state instead of always refetching.
Changes:
- Wrap async Express route handlers with
asyncHandler(Jira/DataDog/LM Studio) and replace silent.catch(() => {})patterns with visible error reporting. - Improve operational logging (e.g., avoid overly verbose
JSON.stringifyfor validation errors) and extract repeated numeric values into constants. - Update client pages to use shared API helpers and perform more reactive state updates after save/delete.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| server/services/telegram.js | Extract health-check interval magic number into a named constant. |
| server/services/character.js | Extract HP calculation constants for clearer intent. |
| server/services/brain.js | Make validation failure logging less noisy while retaining useful signal. |
| server/services/agentPromptBuilder.js | Stop silently swallowing JIRA title generation errors (warn instead). |
| server/routes/lmstudio.js | Wrap LM Studio routes with asyncHandler for consistent async error handling. |
| server/routes/jira.js | Refactor Jira routes to use asyncHandler instead of per-route try/catch. |
| server/routes/datadog.js | Refactor DataDog routes to use asyncHandler instead of per-route try/catch. |
| server/lib/telegramClient.js | Extract retry delays into named constants for readability/tuning. |
| client/src/pages/Jira.jsx | Update instance list locally after save/delete; improve error logging text. |
| client/src/pages/FeatureAgents.jsx | Replace swallowed errors with user-visible toasts (but see review comments re: duplicate toasts). |
| client/src/pages/FeatureAgentDetail.jsx | Same as above for detail view actions (but see duplicate toast concern). |
| client/src/pages/DataDog.jsx | Update instance list locally after save/delete. |
| client/src/pages/CharacterSheet.jsx | Replace bespoke fetch wrapper with shared api service helpers. |
| client/src/hooks/useAutoRefetch.js | Log auto-refetch failures instead of silently ignoring them. |
| client/src/components/digital-twin/tabs/EnrichTab.jsx | Update Digital Twin API method naming and log failures when loading questions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Better Audit -- Code Quality & Style
Summary
11 files improved for code quality, accessibility, and hook stability.
Changes
Files Modified
.env.example, client/src/App.jsx, client/src/components/meatspace/tabs/BodyTab.jsx, client/src/hooks/{useMoltworldWs,useNotifications,useProviderModels,useUpdateChecker}.js(x), client/src/services/apiAccounts.js, server/routes/apps.js, server/services/{autoFixer,cosEvents}.js
Merge Order
Independent -- can be merged in any order