Skip to content

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

Description

@VickyXAI

AgentStatus.restartRequired reads like "a change is waiting for the agent to pick up". It isn't. Two of the five adapters set it to a constant function of configured:

  • apps/desktop/electron/adapters/codex.ts:31restartRequired: configured
  • apps/desktop/electron/adapters/openclaw.ts:33restartRequired: hasOpenClawConfig(config)

So it is permanently true from the moment the agent is connected and never becomes false again. What it actually encodes is a category — "this kind of agent needs a restart when you change it" — which activation already encodes, and which activationLabel already renders honestly as "Restart gateway after changes" / "Restart app after changes".

The flag being a category rather than a state is not itself a bug; it just means nothing can consume it as a state. That is what makes it a trap:

What a real fix needs: something that observes whether the running agent has picked the config up. Desktop writes the config, so it knows the write time; what it lacks is the agent process's start time. For Codex and OpenClaw that is knowable — find the process, read its start time, compare against the managed file's mtime — which would make restartRequired mean what it says and let the pill go back to "Connected" once the user has actually restarted.

Alternative, much cheaper: drop restartRequired from AgentStatus entirely and let activation carry the category, since that is all it currently expresses. The three call sites in manager.ts that return it as part of an action result (168, 175, 182 …) are a different thing and genuinely are a state — those should keep it.

Worth deciding which before anyone else tries to wire the flag into UI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions