-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(cli): swallow synchronous goal-persistence throws at the startup gate (#10311) #10317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,11 @@ export async function waitForGoalRuntime( | |
| ): Promise<boolean> { | ||
| const awaitReady = async (): Promise<void> => { | ||
| try { | ||
| // The call must stay inside the try: with chat recording disabled | ||
| // (--no-chat-recording, settings) getGoalRuntimeReady() THROWS | ||
| // synchronously instead of rejecting, and an escaped rejection kills | ||
| // the AppContainer init effect, freezing the TUI on the init banner | ||
| // forever. | ||
| await config.getGoalRuntimeReady(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The gate fix compensates downstream for a producer contract violation: 中文说明门禁修复是在下游补偿一个生产端契约违背:聊天记录被禁用时, — qwen3.8-max via Qwen Code /review (v0.22.2)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified real against the code: 中文说明已对照代码核实为真实问题:聊天记录被禁用时, |
||
| } catch (error) { | ||
| if (!(error instanceof GoalPersistenceUnavailableError)) throw error; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] This test pins the "other synchronous throws must escape" half only on the unbounded branch; the timeout/
Promise.racebranch — the one the AppContainer startup gate actually uses — has no assertion that the rethrown error propagates, while the sibling swallow test above pins both branches. A future change hardening the race path against freezes (e.g. wrappingPromise.race(...)in.catch(() => 'timeout')) would pass the entire existing suite while silently converting genuinely fatal startup errors into AppContainer's degraded-warning path — the exact gate this PR repairs. Probe-verified at the reviewed commit: with that mutant in place, a probe asserting rejection on the race branch flips from pass to fail while all 8 existing tests stay green (Tests 2 failed | 8 passed). Mirror the first new test's double assertion by adding the timed leg before the test's closing brace:Fix witness: the added assertion itself — removing rejection propagation from the race branch makes it fail while today's suite stays green.
中文说明
该测试只在无超时分支上钉住了"其他同步抛出必须逃逸"这一半;超时/
Promise.race分支 —— 也就是 AppContainer 启动门禁实际使用的分支 —— 没有断言被重新抛出的错误会继续传播,而上方的吞异常兄弟测试在两个分支上都做了钉住。未来若有人加固 race 路径以防卡死(例如把Promise.race(...)包进.catch(() => 'timeout')),整个现有测试套件会全部通过,同时真正的致命启动错误会被悄悄转换成 AppContainer 的降级告警路径 —— 恰恰是本 PR 修复的那个门禁。已在被审提交上通过探针验证:放入该变异体后,断言 race 分支应当拒绝的探针由通过变为失败,而现有 8 个测试全部保持绿色(Tests 2 failed | 8 passed)。请参照第一个新增测试的双重断言,在该测试的结束花括号之前补上有超时的分支:修复见证:新增的这条断言本身就是见证 —— 移除 race 分支上的拒绝传播会使它失败,而当前套件保持全绿。
— qwen3.8-max via Qwen Code /review (v0.22.2)