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

lcm: build the tail from the uncovered rows, converted for the provider

The tail was the last n history inputs, n counted in transcript rows, which assumed one input per row: a session that moved between protocols merges a codex response's items into one chat message or splits a chat turn into several Responses items, so the tail kept too much or silently lost recent rows. Seeding from another strategy compared one transcript row with the first remaining input and failed a bonsai session's turn outright. The tail is now the rows after the leaf cursor, read from the transcript and converted with Context.project as a turn's history is; a cut falls between steps, never inside one response's items, so they convert to exactly the end of the history. Only uncovered rows are decoded, never folded ones. The pinned task is read by its seq. Seeding checks that the converted rows from the cut equal the other strategy's remaining history, and when they do not it seeds nothing and folds from the first row instead of failing. Folds plugins receive the conversion too; SourceStats drops the row counts. Fixes a regression from 394f962: projection.for_model answers newest first, and project passed that order on, so summarizer requests sent the evicted turns reversed and Claude refused a tool output ahead of its call. project now answers oldest first.


Author nekomimi.pet
Date Commit Parent b88f65c8