Use core v0.61.0: safe mode says which line of the config is wrong, and repairs it in one click - #277
Merged
Merged
Conversation
…nd repairs it in one click
When the configuration did not load, core exited in safe mode too and the
app showed "core 未运行 / 已停止" with no reason. Core 0.61.0 now serves the
control plane with a stand-in in that case and reports the rejection from
the start; this is the app side.
- New page in safe mode when the configuration does not load: file, line,
reason (translated: the commonest field errors now have their own
codes), the line itself, and actions: one-click repair (when core offers
one: values outside their choices go back to the default, unknown
fields are removed), open the configuration file at that line, version
history, restart. Other pages are replaced by it (settings stays).
- The yellow "config rejected" banner lists the same fixes with a Repair
button.
- Once a working configuration lands in safe mode (repair, save,
rollback, an edit in another editor), the shell restarts core in normal
mode on its own.
- `safe_mode:<pid>`: the app connects to a safe-mode core on a cold start
too; before, it only connected to `running:` and never learned the
reason.
- `exited:<reason>`: when the safe-mode core still exits, the shell keeps
core's stderr and shows its last error ("core 无法启动" + the reason)
instead of "Stopped". Menu bar and notices treat it like a failed start.
- ConfigRepairPlan / RepairConfig whitelisted; zh translations for the new
codes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Why
After updating to 2026.10.2, a config that still had
client_probes.titling: passthroughmade core exit in safe mode too, and the app showed only "core 未运行 / 已停止" with no reason. Safe mode exists for exactly this case. Core 0.61.0 (ThinkWatch-Core#284) now serves the control plane with a stand-in when the configuration does not load and offers a one-click repair; this is the app side.What
Status.config_rejected): file, line and stage, reason (the commonest field errors are now translated), the line itself, and actions: 一键修复 (when core offers one), 打开配置文件 (editor marks the line), 版本历史, 重新启动. It replaces every page except Settings, since the others would show core's stand-in.ConfigRepairPlan/RepairConfig): lists the fixes (a value outside its choices goes back to the default, an unknown field is removed), then writes through the normal path; the previous version stays in version history. The yellow "config rejected" banner offers the same repair.safe_mode:<pid>: the app connects to a safe-mode core on a cold start too; before, it only connected torunning:and never learned the reason.exited:<reason>: when the safe-mode core still exits (another instance holds the lock, YAML too broken to read the control key), the shell keeps core's stderr and shows its last error as "core 无法启动" + the reason, instead of "已停止". Menu bar and notices treat it like a failed start. Core's stderr is still echoed to the shell's stderr.tw-api.ts, whitelist the two endpoints, zh translations for the new codes, fixtures.Tests
pnpm typecheck,pnpm test(752, new:repair.test.ts,trouble.exited.test.ts)cargo fmt,cargo clippy --all-targets -D warnings,cargo testwith twcore 0.61.0 (new: a safe-mode core that exits reports what it said; last-error parsing)?safe,?rejected,?down=exited): the page, the banner, and a repair that brings the app back to the overviewserve --safeon a broken config →/status→/config/repair→ repaired file and history🤖 Generated with Claude Code