Repository navigation
fix(setup-owner): keep keeper alive after CLI exit - #33
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A newly added test assertion is vulnerable to Python operator precedence (== vs |), so it may not actually verify the combined creation flags value.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR hardens the Windows setup-owner keeper spawn so it can survive the CLI exiting under an outer Windows OpenSSH Job, by requesting CREATE_BREAKAWAY_FROM_JOB (and failing closed when that capability isn’t available).
Changes:
- Switch keeper spawning to use a dedicated
_windows_keeper_creation_flags()helper that includesCREATE_BREAKAWAY_FROM_JOB. - Add a Windows-faked regression test asserting the keeper is spawned with the expected creation flags.
- Add a compatibility test asserting an unsupported breakaway flag fails closed with
SetupOwnerError.
File summaries
| File | Description |
|---|---|
| tests/test_setup_owner.py | Adds regression/compat tests around keeper creation flags and fail-closed behavior. |
| src/blendersessiond/setup_owner.py | Adds Windows keeper creation flags helper and uses it when spawning the keeper. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| setup_owner._spawn_keeper(tmp_path) | ||
|
|
||
| assert calls[0]["creationflags"] == 0x200 | 0x400 | 0x800 |
|
Verified exact head
No Blender Session was launched or stopped. Operator host details remain private. |
Problem
The setup-owner CLI launches its detached keeper inside the Windows OpenSSH outer Job. When the CLI exits, that outer Job tears down the keeper before it can finish, leaving a published receipt that later reconciles as
owner_lost/cleanup_unverified.Fix
Request
CREATE_BREAKAWAY_FROM_JOBtogether with the existing process-group and detached flags. The keeper can then escape an outer Job that permits breakaway while preserving the exact unnamed kill-on-close Job assigned to the PowerShell setup tree. Missing Windows flag support fails closed withSetupOwnerError.Verification
./.venv/bin/python -m pytest -q— 203 passed, 9 skipped./.venv/bin/ruff check src tests— passedgit diff --check— passedThe live Hermes repro is authorized and should be rerun by the integration owner after this dependency lands.
Model: GPT-5.6
Harness: Codex desktop