Skip to content
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
myobie merged 1 commit into
mainfrom
reload-regen-ding-root
Jul 13, 2026
Merged

reload: heal ding --root on reload + --write-only (cold-start durability for pre-#43 pty.tomls)#45
myobie merged 1 commit into
mainfrom
reload-regen-ding-root

Conversation

@myobie

@myobie myobie commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

v1 — reload heals the ding --root; --write-only heals the pty.toml without respawn

Closes the cold-start durability gap. 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, root lives only in [sessions.ding.env]. Since convoy up respawns via pty restart = stored metadata (no env), a convoy reload / cold convoy up re-materializes an env-only ding that drops ST_ROOT on 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> (via dingCommand), idempotent, leaving [sessions.claude] verbatim.
  • cmdReload runs 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-run previews the heal (before → after).

Why ding-block only (not full writePtyToml regen)

writePtyToml needs an AgentSpec, but role, personaOverride, and the --resume uuid 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

  • tsc clean, 151 tests green (adds regenerateDingRoot: heal / idempotent / dryRun-doesn't-write / no-ding).
  • Real dry-run against the live stale evals pty.toml: heal preview correct, --write-only reports "running sessions left untouched", file unchanged.

Follow-up (v2, documented — not this PR)

Embed the AgentSpec as a [convoy.spec] table in the pty.toml → reload can fully regenerate (role/persona/resume included) and auto-pick-up any future writePtyToml fix. Bigger (schema + parse + resume-preserve + legacy fallback); v1 unblocks the durability close now.

After merge

I'll convoy reload <agent> --write-only across 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.

… 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.
@myobie
myobie merged commit 75fdc46 into main Jul 13, 2026
@myobie
myobie deleted the reload-regen-ding-root branch July 13, 2026 04:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant