small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo

fix(kernel): number frames sent before a late hello past what the kernel saw

Trigger: a daemon attaches to a kernel whose record an older daemon wrote, so out_seq lags what the kernel has seen (that daemon did not count its replies to cells.started). The attach cannot reach the kernel, as with a remote kernel while ssh is down, and the driver serves without a hello. A cell sent meanwhile is numbered from the lagging record. Wrong behavior: when the background reattach is greeted, the hello's max(out, kack) only protects frames numbered after it. The hello resends only outbox frames above kack, so the cell numbered at or below it is never resent, and the copy written to a connected but ungreeted kernel is dropped as a repeat. The cell never runs. A frame written before the hello under a number above the kernel's could instead be taken, then taken again once renumbered. Fix: the driver writes no sequenced frame until the kernel greets; it remembers the first seq numbered meanwhile. At the hello, if that is at or below kack, Link.renumber moves those frames (outbox rows, saved reply seqs, and out_seq) past kack in order, and the hello sends every frame the kernel has not seen. A reply to cells.started made before the hello is saved, since the kernel waits for it with no deadline. The shutdown request still goes out at once: nothing follows it to renumber it.


Author aly.codes
Date Commit Parent 85c3095c