fix: use warning color for retry status (#385) and replace console.*/silent catches with structured logging#802
Open
MrRealORG wants to merge 1 commit into
Conversation
…console.*/silent catches with structured logging - Fix XiaomiMiMo#385: Retry status text now uses theme.warning (yellow) instead of theme.error (red), since rate-limit retries are transient, not fatal - Remove 3 duplicate console.error/console.warn calls in plugin/runtime.ts (log.error/log.warn already handle these on preceding lines) - Replace 3 silent .catch(() => {}) in context/sdk.tsx with log.warn/log.error (workspace sync failures + SSE event loop crash) - Replace 1 silent .catch(() => {}) in context/local.tsx with log.warn (model preferences read failure)
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
Fixes #385 + code quality improvements
Retry status color (#385)
prompt/index.tsx: Changedtheme.error(red) totheme.warning(yellow) for retry status textRemove duplicate console.* calls (P1)
plugin/runtime.ts: Removed 3 lines ofconsole.error/console.warnthat duplicated thelog.error/log.warncalls on the preceding linesReplace silent .catch(() => {}) with structured logging (P2)
context/sdk.tsx: AddedLogimport + 3 replacements:sdk.sync.start().catch(() => {})→.catch((err) => log.warn("Workspace sync failed", ...)).catch(() => {})→.catch((err) => log.error("SSE event loop crashed", ...))context/local.tsx: AddedLogimport + 1 replacement:.catch(() => {})→.catch((err) => log.warn("Failed to read model preferences", ...))Files changed
prompt/index.tsx— 1 line (color change)plugin/runtime.ts— 3 lines removedcontext/sdk.tsx— 5 lines changed (import + logger + 3 catches)context/local.tsx— 3 lines changed (import + logger + 1 catch)