qwen-code/packages/cli
ChiGao 93af84f248
fix(cli): surface unhandled rejections and render errors instead of swallowing them (#7406)
* fix(cli): surface unhandled rejections and render errors instead of swallowing them

Unhandled promise rejections were emitted to AppEvent.LogError which has
no production listener, making crashes completely invisible in debug logs
and stderr. Additionally, the main App tree had no top-level
ErrorBoundary, so React render errors were caught only by Ink's internal
boundary which silently exits via exitPromise.catch(noop).

- Write unhandled rejection details to the debug logger so they appear
  in ~/.qwen/debug/<session>.txt
- Wrap the interactive UI tree in an ErrorBoundary that logs fatal
  render errors and shows a fallback message instead of silent exit

* fix(cli): address review feedback — normalize non-Error throws and add exit path

- Normalize non-Error thrown values (strings, null, etc.) to Error
  instances in ErrorBoundary before logging/rendering, preventing
  secondary TypeErrors from sanitizeTerminalText(undefined)
- Schedule a graceful exit (5s delay) from the fatal render error
  fallback so the session does not hang under the Kitty keyboard
  protocol where Ctrl+C is a keypress, not SIGINT

* test(cli): add test for non-Error thrown value normalization in ErrorBoundary

---------

Co-authored-by: 秦奇 <gary.gq@alibaba-inc.com>
2026-07-23 08:38:47 +00:00
..
src fix(cli): surface unhandled rejections and render errors instead of swallowing them (#7406) 2026-07-23 08:38:47 +00:00
.gitignore feat(core): add opt-in built-in web_search backed by the DashScope Responses API (#7215) 2026-07-21 10:59:36 +00:00
index.ts fix(cli): add bootstrap fast paths (#6188) 2026-07-02 22:28:11 +00:00
package.json Fix(cli): use npm view for update check instead of update-notifier (#7515) (#7528) 2026-07-23 08:36:35 +00:00
test-setup.ts feat(serve): persist dynamic workspace registrations (#6716) 2026-07-11 16:49:40 +00:00
tsconfig.json feat(webshell): replay ChatRecord history in readonly WebShell (#6999) 2026-07-19 00:09:44 +00:00
vitest.config.ts test: raise timeout ceiling for I/O-bound tests flaky under CI contention (#7230) 2026-07-19 12:03:48 +00:00