Skip to content

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
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-retry-color-logging
Open

fix: use warning color for retry status (#385) and replace console.*/silent catches with structured logging#802
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-retry-color-logging

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Fixes #385 + code quality improvements

Retry status color (#385)

  • prompt/index.tsx: Changed theme.error (red) to theme.warning (yellow) for retry status text
  • Rate-limit retries (429) are transient and succeed after backoff, but were displayed in alarming red
  • Users reported seeing "error" when the request actually works fine after the retry

Remove duplicate console.* calls (P1)

  • plugin/runtime.ts: Removed 3 lines of console.error/console.warn that duplicated the log.error/log.warn calls on the preceding lines
  • These raw console calls corrupt the TUI terminal display

Replace silent .catch(() => {}) with structured logging (P2)

  • context/sdk.tsx: Added Log import + 3 replacements:
    • 2x sdk.sync.start().catch(() => {}).catch((err) => log.warn("Workspace sync failed", ...))
    • 1x SSE event loop .catch(() => {}).catch((err) => log.error("SSE event loop crashed", ...))
  • context/local.tsx: Added Log import + 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 removed
  • context/sdk.tsx — 5 lines changed (import + logger + 3 catches)
  • context/local.tsx — 3 lines changed (import + logger + 1 catch)

…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

提示Erorr code 429,但实际上看起来工作正常

1 participant