This repository was archived by the owner on Jul 24, 2026. It is now read-only.
reload: heal ding --root on reload + --write-only (cold-start durability for pre-#43 pty.tomls) - #45
Merged
Merged
Conversation
… respawn convoy#43 fixed writePtyToml so NEW agents get --root in the ding command, but the existing agents' on-disk pty.tomls are still pre-#43: the ding command has no --root and the root lives only in [sessions.ding.env]. convoy up respawns via pty restart = stored metadata (no env), so a convoy reload / cold up re-materializes an env-only ding that drops ST_ROOT on its next restart -- the original bug returns. regenerateDingRoot(dir) surgically rewrites ONLY the [sessions.ding] command to carry --root <net> (via dingCommand), idempotently, leaving [sessions.claude] -- the role boot prompt + --resume uuid, which are NOT structurally recoverable from the pty.toml -- VERBATIM. cmdReload runs it before re-materializing so the fresh spawn + every future cold-up gets a durable ding. New --write-only flag heals the pty.toml WITHOUT kill/respawn, so the already-durable running fleet's files heal with zero disruption. --dry-run previews the heal. tsc clean, 151 tests green (adds regenerateDingRoot heal/idempotent/dryRun/no-ding). Follow-up (v2, documented): embed the AgentSpec as a [convoy.spec] table so reload can FULLY regenerate (role/persona/resume) + auto-pick-up any future writePtyToml fix. v1 scopes to the ding block to avoid guessing role / stripping --resume.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v1 — reload heals the ding
--root;--write-onlyheals the pty.toml without respawnCloses the cold-start durability gap. convoy#43 fixed
writePtyTomlso NEW agents get--rootin the ding command, but the existing agents' on-disk pty.tomls are still pre-#43: the ding command has no--root, root lives only in[sessions.ding.env]. Sinceconvoy uprespawns viapty restart= stored metadata (no env), aconvoy reload/ coldconvoy upre-materializes an env-only ding that dropsST_ROOTon its next restart — the original phantom-loop/non-delivery bug returns for that agent.What
regenerateDingRoot(dir, {dryRun?})(launch.ts) — surgically rewrites only the[sessions.ding]command to carry--root <net>(viadingCommand), idempotent, leaving[sessions.claude]verbatim.cmdReloadruns the heal before re-materializing → the fresh spawn and every future cold-up get a durable ding.convoy reload <id> --write-only— heals the pty.toml without kill/respawn, so the already-durable running fleet's files heal with zero disruption.--dry-runpreviews the heal (before → after).Why ding-block only (not full
writePtyTomlregen)writePtyTomlneeds anAgentSpec, butrole,personaOverride, and the--resumeuuid are not structurally recoverable from the pty.toml — they only live inside the harness command text. A naive full regen would guess the role's boot prompt and strip--resume, cold-booting the agent (e.g. cos's--resume 2A589620). The ST_ROOT durability gap lives entirely in the ding block, so scoping the regen there closes it with zero harness risk.Verified
regenerateDingRoot: heal / idempotent / dryRun-doesn't-write / no-ding).evalspty.toml: heal preview correct,--write-onlyreports "running sessions left untouched", file unchanged.Follow-up (v2, documented — not this PR)
Embed the
AgentSpecas a[convoy.spec]table in the pty.toml → reload can fully regenerate (role/persona/resume included) and auto-pick-up any futurewritePtyTomlfix. Bigger (schema + parse + resume-preserve + legacy fallback); v1 unblocks the durability close now.After merge
I'll
convoy reload <agent> --write-onlyacross the 15 to heal their on-disk pty.tomls (no fleet disruption), closing the cold-start path for all existing agents. cos's pty.toml is already reconciled + carries--root, so it's a verified no-op there.