desktop: delete AgentStatus.restartRequired — nothing could ever read it - #379
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughChangesAgent status cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Agent status no longer exposes a misleading restart-pending flag, while activation guidance remains available. No current merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Five adapters wrote it, five demo entries mirrored it, and not one line
in the app read it. It was write-only state whose only effect was to look
consumable.
It could not be consumed. Codex and OpenClaw set it to a constant
function of `configured`, so it was permanently true from the moment the
agent connected — it encoded a category ("this kind of agent needs a
restart when you change it"), which `activation` already encodes and
`activationLabel` already renders as "Restart gateway/app after changes".
Reading it as a state pins those two to a permanent "Restart pending",
which is what a reviewer suggestion on #367 would have shipped.
The honest reason no adapter can fill it in is that nothing observes
whether an agent process has picked a config change up. Desktop knows
when it wrote the file; it does not know when the agent last started, and
for a CLI invoked per-session there is no such moment to compare against.
A field that cannot be computed should not exist, so `types.ts` now says
that where the field used to be.
`WalletMutationResult.restartRequired` and
`PaymentChainSwitchResult.restartRequired` are untouched. There it is a
real state: Desktop has just written the config itself and knows whether
it also restarted the thing that reads it. `manager.test.ts` pins that
behaviour and still passes.
Closes #377.
Verified: tsc clean, 46 tests pass, vite build and esbuild electron build
clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015mUab3xrLHNpYqVHJLgJHL
cc03a54 to
5d994cd
Compare
Closes #377.
The field was write-only
Five adapters wrote
AgentStatus.restartRequired, five demo entries mirrored it, and nothing read it — notApp.tsx, not anything underelectron/. Its only effect was to look consumable.And it wasn't.
codex.ts:31andopenclaw.ts:33set it to a constant function ofconfigured, so it was permanently true from the moment the agent connected. What it encoded is a category — "this kind of agent needs a restart when you change it" — whichactivationalready encodes andactivationLabelalready renders as "Restart gateway after changes" / "Restart app after changes".That gap is not theoretical. A reviewer suggestion on #367 was to branch
healthLabelon it; applied, it would have pinned Codex and OpenClaw to a permanent "Restart pending" pill — strictly worse than the "Connected" it replaced. @ramioca hit the same flag from the other side in #371's notes.Why no adapter can fill it in honestly
Nothing observes whether an agent process has picked a config change up. Desktop knows when it wrote the file; it does not know when the agent last started, and for a CLI invoked per session there is no such moment to compare against. #371 resolved the two cases that were resolvable — Hermes by proving no restart is ever needed, the chain switch by doing the restart. Codex and OpenClaw are what's left, and neither is fixable that way because Desktop doesn't own those processes.
A field that cannot be computed shouldn't exist.
types.tsnow carries that reasoning where the field used to be, so re-adding it means reading the argument first.What is deliberately untouched
WalletMutationResult.restartRequiredandPaymentChainSwitchResult.restartRequired. There it is a genuine state — Desktop has just written the config itself and knows whether it also restarted the thing that reads it.manager.test.tspins that behaviour and still passes.Verification
tsc --noEmitclean, 46 tests pass,vite buildand the esbuild electron build clean. Net −13/+7 lines.Landing order
Branched off
main. #371 toucheshermes.tsand #367 touchesapi.tson lines this deletes, so land this after both — the rebase is trivial (the lines it wants are gone either way), but taken first it'll conflict with them.🤖 Generated with Claude Code
https://claude.ai/code/session_015mUab3xrLHNpYqVHJLgJHL
Summary by CodeRabbit