Skip to content

fix(server): create runtime directory before acquiring spawn lock - #1253

Open
shua0326 wants to merge 1 commit into
1jehuang:masterfrom
shua0326:fix/spawn-lock-runtime-directory
Open

shua0326 wants to merge 1 commit into
1jehuang:masterfrom
shua0326:fix/spawn-lock-runtime-directory

Conversation

@shua0326

Copy link
Copy Markdown

Creates the runtime directory before opening the daemon spawn lock. This fixes startup failing with No such file or directory when the directory does not exist, including ACP startup.

Adds a regression test for directory creation, lock exclusion, and cleanup.

Validation: library compilation and formatting checks passed. The two lock tests passed in a standalone harness using the exact source and tests; the new test failed before the fix. The repository test build is blocked by five existing ModelRoute initializers missing usage.

Fixes #1252

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

Safe to merge.

What we checked:

  • T-Rex attempted the repository’s targeted spawn-lock unit test, but test-crate compilation was blocked by five unrelated ModelRoute initializers in src/cli/commands_tests.rs that lack usage. T-Rex
  • T-Rex ran an isolated executable built from the current SpawnLockGuard and try_acquire_spawn_lock implementation. T-Rex
  • The executable started without the nested parent directory, acquired the spawn lock, prevented another process from acquiring it, released the guard, and confirmed the lock file was removed while the runtime directory remained. T-Rex
  • T-Rex observed post-run success artifacts, including the post-run log, the Python-based isolated validation harness, the targeted-unit-test launcher, and the root-test blocker capture used for validation. T-Rex

Summary

  • Creates the Unix runtime directory before acquiring the daemon spawn lock, allowing first-time startup with a nested runtime path.
  • Confirms the lock prevents concurrent startup, removes its lock file when released, and retains the runtime directory.

T-Rex validation blocked

  • The repository’s targeted unit-test command cannot compile because five unrelated ModelRoute initializers in src/cli/commands_tests.rs are missing the required usage field. An isolated executable built from the changed spawn-lock implementation completed the relevant runtime checks successfully.

Reviews (1) · Last reviewed commit: "fix(server): create runtime directory be..."

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.

Daemon startup fails when the runtime directory does not exist

1 participant