Skip to content

desktop: delete AgentStatus.restartRequired — nothing could ever read it - #379

Merged
VickyXAI merged 1 commit into
mainfrom
fix/377-restart-required
Sep 10, 2026
Merged

desktop: delete AgentStatus.restartRequired — nothing could ever read it#379
VickyXAI merged 1 commit into
mainfrom
fix/377-restart-required

Conversation

@VickyXAI

@VickyXAI VickyXAI commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Closes #377.

The field was write-only

Five adapters wrote AgentStatus.restartRequired, five demo entries mirrored it, and nothing read it — not App.tsx, not anything under electron/. Its only effect was to look consumable.

And it wasn't. codex.ts:31 and openclaw.ts:33 set it to a constant function of configured, 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" — which activation already encodes and activationLabel already renders as "Restart gateway after changes" / "Restart app after changes".

That gap is not theoretical. A reviewer suggestion on #367 was to branch healthLabel on 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.ts now carries that reasoning where the field used to be, so re-adding it means reading the argument first.

What is deliberately untouched

WalletMutationResult.restartRequired and PaymentChainSwitchResult.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.ts pins that behaviour and still passes.

Verification

tsc --noEmit clean, 46 tests pass, vite build and the esbuild electron build clean. Net −13/+7 lines.

Landing order

Branched off main. #371 touches hermes.ts and #367 touches api.ts on 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

  • Changes
    • Removed the restart-required indicator from agent status information.
    • Agent status continues to report configuration and activation details.
    • Updated demo agent statuses to match the streamlined status information.
    • Updated the Hermes demo status to use immediate activation.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: fcad0b6b-c195-446d-917f-2bbb8a627077

📥 Commits

Reviewing files that changed from the base of the PR and between cc03a54 and 5d994cd.

📒 Files selected for processing (2)
  • apps/desktop/electron/adapters/hermes.ts
  • apps/desktop/src/api.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Agent status cleanup

Layer / File(s) Summary
Remove restartRequired from the status contract
apps/desktop/electron/core/types.ts, apps/desktop/electron/adapters/shared.ts
AgentStatus and statusShape no longer define or return restartRequired.
Update adapter and demo status responses
apps/desktop/electron/adapters/*.ts, apps/desktop/src/api.ts
The five adapters and five demo agent responses no longer include restartRequired. The Hermes demo now uses immediate activation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Suggested reviewers: killerqueen-z, ramioca

Merge Risk: ⚪ Minimal · up to 5d994

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: removing the write-only AgentStatus.restartRequired field.
Linked Issues check ✅ Passed The changes satisfy issue #377 by removing AgentStatus.restartRequired from the type, shared status construction, adapters, and demo data. The PR preserves restartRequired on action result types and r…
Out of Scope Changes check ✅ Passed The changes remain within issue #377. The Hermes activation update supports the same objective by representing that Hermes does not require a restart. No unrelated code changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/377-restart-required

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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
@VickyXAI
VickyXAI force-pushed the fix/377-restart-required branch from cc03a54 to 5d994cd Compare September 10, 2026 04:54
@VickyXAI
VickyXAI merged commit 05de1e0 into main Sep 10, 2026
5 checks passed
@VickyXAI
VickyXAI deleted the fix/377-restart-required branch September 10, 2026 04:58
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.

restartRequired is a category, not a state — nothing can consume it as one

1 participant