Skip to content

feat(cli): dimos restart command (DIM-683)#1445

Closed
spomichter wants to merge 1 commit intofeat/dim-681-daemon-modefrom
feat/dim-683-restart
Closed

feat(cli): dimos restart command (DIM-683)#1445
spomichter wants to merge 1 commit intofeat/dim-681-daemon-modefrom
feat/dim-683-restart

Conversation

@spomichter
Copy link
Contributor

adds dimos restart — stops running instance and re-launches with same blueprint args and config overrides.

  • --force / -f for SIGKILL before restart
  • --daemon / -d to restart in background
  • uses os.execvp to replace process cleanly
  • reads saved cli_args and config_overrides from registry entry

Closes DIM-683

stops the running instance, then re-launches with the same
blueprint args and config overrides. supports --daemon and --force.
uses os.execvp to replace the process cleanly.

Closes DIM-683
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 6, 2026

Greptile Summary

This PR adds a dimos restart CLI command that stops the currently running DimOS instance and re-launches it with the same blueprint arguments and global config overrides, using os.execvp to cleanly replace the current process. The implementation is straightforward and well-integrated with the existing _stop_entry / run_registry infrastructure. However, there is one logic bug that needs fixing before merge:

  • False boolean overrides are silently lost — the reconstruction loop (lines 289–291) only emits --<flag> when the stored value is True; it never emits --no-<flag> for False values, so any override originally set with --no-<flag> is silently ignored on restart.

Confidence Score: 4/5

  • Safe to merge after fixing the boolean override bug; the core restart flow is sound and well-integrated.
  • One verified logic bug (False boolean overrides dropped on restart) with a simple, localized fix. The bug causes silent misconfiguration when restarting after using --no-flag options, but the underlying mechanism (stop, execvp, run) is correct. No safety or security issues; the implementation properly uses os.execvp for clean process replacement and preserves the run registry pattern.
  • dimos/robot/cli/dimos.py — boolean override reconstruction block (lines 289–291) needs to handle False values with --no- prefix.

Last reviewed commit: c52d320

Comment on lines +289 to +291
if isinstance(value, bool):
if value:
cmd.append(flag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False boolean overrides are silently lost during restart.

When a boolean config override is False (e.g., user originally ran dimos --no-some-flag run blueprint), the reconstruction loop at lines 289–291 only emits a flag for True values. Since the CLI uses a --flag/--no-flag pattern (line 70), False values need to emit --no-<flag> to be restored correctly.

Suggested change
if isinstance(value, bool):
if value:
cmd.append(flag)
if isinstance(value, bool):
if value:
cmd.append(flag)
else:
cmd.append(f"--no-{key.replace('_', '-')}")

@spomichter
Copy link
Contributor Author

Superseded by #1476 which targets dev directly and uses the current stop_entry() API from the merged daemon PR (#1436).

@spomichter spomichter closed this Mar 7, 2026
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.

1 participant