Skip to content

feat: run mo in background by default#50

Merged
k1LoW merged 4 commits intomainfrom
background
Mar 2, 2026
Merged

feat: run mo in background by default#50
k1LoW merged 4 commits intomainfrom
background

Conversation

@k1LoW
Copy link
Copy Markdown
Owner

@k1LoW k1LoW commented Mar 2, 2026

Summary

  • Run mo server as a background process by default so the shell returns immediately after startup. This makes mo easy to incorporate into scripts, tool chains, and LLM-driven workflows.
  • Add --foreground flag to keep the server in the foreground when needed (e.g. debugging, make dev).
  • Add --shutdown user-facing stderr messages alongside existing slog for tryAddToExisting and doShutdown.
  • Extract server.WriteRestoreFile() to deduplicate temp file writing between ExportState and background startup.
  • Extract openBrowser() helper to deduplicate browser-open logic.
  • Use os.Executable() + Setsid (setSysProcAttr) for robust process detachment on Unix.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 2, 2026

Code Metrics Report

main (28e60d2) #50 (be8d871) +/-
Coverage 41.1% 40.3% -0.9%
Code to Test Ratio 1:0.4 1:0.4 -0.1
Test Execution Time 34s 33s -1s
Details
  |                     | main (28e60d2) | #50 (be8d871) |  +/-  |
  |---------------------|----------------|---------------|-------|
- | Coverage            |          41.1% |         40.3% | -0.9% |
  |   Files             |             25 |            26 |    +1 |
  |   Lines             |           2459 |          2512 |   +53 |
  |   Covered           |           1013 |          1013 |     0 |
- | Code to Test Ratio  |          1:0.4 |         1:0.4 |  -0.1 |
  |   Code              |           2968 |          2984 |   +16 |
  |   Test              |           1326 |          1326 |     0 |
+ | Test Execution Time |            34s |           33s |   -1s |

Code coverage of files in pull request scope (19.6% → 18.3%)

Files Coverage +/- Status
cmd/root.go 0.0% 0.0% modified
cmd/sysprocattr_unix.go 0.0% 0.0% added
internal/server/server.go 27.9% -0.2% modified

Reported by octocov

@k1LoW k1LoW merged commit 118f609 into main Mar 2, 2026
3 checks passed
@k1LoW k1LoW deleted the background branch March 2, 2026 22:28
@github-actions github-actions Bot mentioned this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant