Skip to content

fix: an up after a down takes the changed stack file (#490) - #493

Merged
7schmiede merged 1 commit into
mainfrom
fix/up-restarts-a-stale-idle-daemon
Nov 9, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/up-restarts-a-stale-idle-daemon

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

After a stack-file change, devstack status says it applies with down + up. The CLI's down ends the daemon (/v1/shutdown), but the MCP tool down (and the dashboard's stop) only stops the tree (POST /v1/down); the daemon then ends by itself a few seconds later (ADR-0095, GRACE). An up within that time reached the same daemon, which still held the stack file it read at its start: services restarted without the new variable, and the warning stayed (#490).

ensure_daemon, which every up goes through (CLI, MCP, the hub's start), now ends a daemon that read an older stack file and runs nothing (no service of the main tree, no lane; /v1/shutdown?unless_lanes=true, so a lane started meanwhile keeps it) and starts a new one. A daemon in which something runs stays, and status says how the change applies.

Closes #490

Cause An up that finds a daemon uses it; a daemon reads the stack file once, and one that ran nothing after POST /v1/down was still there for a few seconds.
Bug class stale-config (sibling of #487, fixed in #489 for a lane)
Proof New integration test an_up_after_a_down_reads_the_changed_stack_file: red on main (the service read one after the change to two), green with the fix. A second, over-eager version (ending the daemon even while its services run) fails the test's second half (the daemon's pid must stay).
Siblings A lane: #489. The dashboard's start goes through devstack up (start_up), so through this fix. A main tree whose daemon serves lanes keeps its file until down --all; status says so since #489.
Guard The test, in the integration suite of every platform.

No review card: a fix within ADR-0095 that makes the documented down + up true.

🤖 Generated with Claude Code

The MCP tool `down` (POST /v1/down) stops the main tree and leaves the
daemon its few seconds before it ends by itself; an `up` in that time ran
in that daemon, with the stack file it read at its start. `ensure_daemon`
now ends a daemon that read an older stack file and runs nothing (no
service of the main tree, no lane) before it starts one, so every way to
`up` (CLI, MCP, the hub's start) reads the file as it is. A daemon in which
something runs stays.

Bug-Class: stale-config
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit eaa6b6a into main Nov 9, 2026
@7schmiede
7schmiede deleted the fix/up-restarts-a-stale-idle-daemon branch November 9, 2026 16:27
@7schmiede 7schmiede mentioned this pull request Nov 9, 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.

down + up does not restart the daemon, so a stack-file change stays unapplied

1 participant