Skip to main content

Module srv_spawner

Module srv_spawner 

Source

Structs§

EstartFields 🔒
Parsed fields out of a AGENTMUXSRV-ESTART line. Same shape as the host’s parse_estart in sidecar.rs, minus version.
SrvSpawnResult
What the launcher learns about srv after it signals ready. Held by the launcher and used to populate env vars the host reads.

Enums§

EstartWait 🔒
Outcome of waiting for srv’s readiness signal. Module-level (not local to spawn_srv) so prefer_buffered_failure can be unit-tested.
MigrationLine 🔒
SrvSpawnError
Errors during srv spawn — granular enough that the launcher can log the right diagnostic.

Constants§

MIGRATION_FAILED_DIALOG_TITLE
Title for the fatal dialog both supervisors show on MigrationFailed.

Functions§

json_str 🔒
json_u64 🔒
migration_failed_dialog_body
Body for that dialog. Kept here (not in each supervisor) so Windows and Unix show the same words.
parse_estart 🔒
parse_migration_line 🔒
prefer_buffered_failure 🔒
Second guard for the ESTART-vs-failure race (reagent P1, post-merge on #3043). The stderr reader task sends the migration-failure reason and then drops every sender as srv exits, so by the time the waiter’s select! runs, BOTH “failure buffered” and “ESTART channel closed” are ready. biased; in the select makes the failure arm win when both are seen in one poll; this covers the remaining shape, where the closed channel was observed first and the reason is sitting in failure_rx unread. Every other outcome passes through unchanged.
resolve_srv_binary 🔒
Resolve the agentmux-srv binary path from the LAUNCHER’s vantage point.
run_migrate
Run agentmux-srv migrate as a standalone subprocess.
spawn_srv
Spawn srv as a child of the launcher, assigned to launcher’s Job Object J0 so it dies cleanly with the launcher tree.