Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

crash-ding: page cos + the crashed worker's spawner, not the whole permanent crew (Nathan-flagged) + double-ding fix - #48

Merged
myobie merged 1 commit into
mainfrom
crash-ding-targeting
Jul 15, 2026
Merged

crash-ding: page cos + the crashed worker's spawner, not the whole permanent crew (Nathan-flagged) + double-ding fix#48
myobie merged 1 commit into
mainfrom
crash-ding-targeting

Conversation

@myobie

@myobie myobie commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Crash-ding: page cos + the worker's actual supervisor — not the whole permanent crew

Fixes the Nathan-flagged targeting bug + a double-ding I found diagnosing the crashtest test.

The bug

crashDingTargets paged every --permanent agent — permanence was used as a proxy for "orchestrator." But every repo-owner runs --permanent (they're long-lived), so one throwaway worker crash paged the entire standing crew (13 agents) and pulled app-apple off its task.

Targeting fix (crashDingTargets)

Now targets:

  • (a) the CoS — always (network-wide backstop), resolved by a convoy.tier=cos tag (no hardcoded id).
  • (b) the crashed agent's ACTUAL supervisor — its convoy.spawner tag (the bus id of whoever ran convoy add).

NOT the permanent set. --notify extras + no-self-ding preserved.

Wiring (writePtyToml / nativeLaunch)

Correct-by-construction: convoy add stamps, on the harness session only (never the ding sidecar):

  • convoy.tier=cos when role=chief-of-staff.
  • convoy.spawner=<ST_AGENT of the spawning shell> — whoever spawned it owns it; null (human-spawned) → cos-only ding.

convoy up re-asserts both tags across a permanent respawn (pty restart strips tags), so the cos backstop survives cos restarting.

Double-ding fix (bonus, found while diagnosing)

A worker's ding sidecar fired its own crash-ding alongside the agent (both resolve the same busId) → 2 dings per crash. Ding sessions are now excluded from crash/flapping dings (still respawned for permanents, just silently). One crash = one ding.

Design note

Chose the spawner tag (cos's lean) over a role/tier-only signal — it identifies the specific supervisor of this worker (not all supervisors), which is exactly "the crashed worker's actual supervisor."

Verified

  • tsc clean, 163 tests green. Includes the acceptance: a worker crash pages ONLY cos + its spawner, NOT unrelated permanents like app-apple; plus the clean-exit-silent negative control (workerCrashed unchanged: exit 0 = silent, nonzero/vanished/null = crash); plus writePtyToml tag wiring (agent gets the tags, ding does not).

After merge

Nathan restarts convoy up once to activate (the running supervisor holds the old code until then). Existing agents get their convoy.spawner/convoy.tier tags on their next convoy add/reload; a convoy reload <cos> (or re-add) stamps convoy.tier=cos on cos. Until an agent is re-materialized it has no spawner tag → its crash falls back to cos-only (safe).

…crew (Nathan-flagged) + fix double-ding

The crash-ding paged EVERY --permanent agent on one worker crash — permanence was used
as a proxy for "orchestrator," but every repo-owner runs --permanent, so a throwaway
worker crash paged the entire standing crew (13 agents; pulled app-apple off task).

TARGETING (crashDingTargets): now targets (a) the CoS — always, via a convoy.tier=cos
tag (network-wide backstop, no hardcoded id); (b) the crashed agent's ACTUAL supervisor
— its convoy.spawner tag (bus id of whoever ran convoy add). NOT the permanent set.
notify + no-self-ding preserved.

WIRING (writePtyToml/nativeLaunch): stamp convoy.tier=cos (role=chief-of-staff) +
convoy.spawner=<ST_AGENT of the add-er> on the HARNESS session (never the ding sidecar).
convoy up re-asserts both across a permanent respawn (pty restart strips tags) so the
cos backstop survives cos restarting.

DOUBLE-DING (found while diagnosing the crashtest test): a worker's DING sidecar fired
its own crash-ding alongside the agent (both resolve the same busId) -> 2 dings/crash.
Ding sessions are now excluded from crash/flapping dings (still respawned for permanents,
silently). One crash = one ding.

Preserved: clean exit 0 = silent; nonzero/vanished/null = crash (workerCrashed unchanged).
tsc clean, 163 green — incl the acceptance (worker crash pages ONLY cos + its spawner,
NOT unrelated permanents like app-apple), the clean-exit-silent negative control, and the
writePtyToml tag wiring.
@myobie
myobie merged commit ce181bb into main Jul 15, 2026
@myobie
myobie deleted the crash-ding-targeting branch July 15, 2026 12:14
myobie added a commit that referenced this pull request Jul 21, 2026
…(crash-ding regression) (#102)

On a worker crash, `convoy up`'s crash-ding is meant to page BOTH the CoS (the
always-on backstop, via convoy.tier=cos) AND the worker's actual supervisor (via
its convoy.spawner tag) — the two-recipient design from #48.

The declarative arc broke the supervisor half. `agentFileToSpec` DROPPED the
agent file's `supervisor` field, so it never reached the launch path; and
`writeAgentFiles` stamped convoy.spawner from the LAUNCHING process's ST_AGENT —
which, in the declarative flow, is the `convoy up` HOST, not the parent. So a
declared worker's convoy.spawner became the host (often == the CoS, then deduped),
and its real supervisor was never dinged.

Fix: carry `supervisor` on AgentSpec, map af.supervisor → spec.supervisor in
agentFileToSpec, and stamp convoy.spawner = spec.supervisor ?? ST_AGENT in
writeAgentFiles. The declared supervisor is now authoritative; ST_AGENT stays the
fallback for the imperative `convoy run` path (no declared supervisor).

Surfaced by the evals crash-ding cell (cd-cos got the notice; cd-sup's inbox
stayed empty). +2 regression tests: agentFileToSpec carries supervisor, and
writeAgentFiles prefers the declared supervisor over the host's ST_AGENT.


Claude-Session: https://claude.ai/code/session_01MCzqQKSpPiNX2ketyubByS

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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