Skip to content

Commit cb0f2a1

Browse files
iceteaSATehan
andauthored
test(transform): pad the newest-20 skeleton window for the legacy full-drop expectation (#138)
Upstream db7bc0a (tool skeletons for newest-20 drops) updated apply-operations.tool-drop.test.ts via padSkeletonWindow but missed this transform-level test, which queues drops on a 2-message session — trivially inside the skeleton window, so the dropped tool now survives as a truncated skeleton and the 'fully dropped' assertion fails on PRISTINE upstream/master too (verified in a clean worktree: v0.23.0 passes 37/37, 4e3635c fails 36/37). Same remediation upstream applied to its own tests: insert 20 newer tool tags so the drop exercises the deep-history full-removal path the test documents. Co-authored-by: Tehan <claude@tehan.xyz>
1 parent 4e3635c commit cb0f2a1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/plugin/src/hooks/magic-context/transform.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
getTagById,
2727
getTagsBySession,
2828
incrementHistorianFailure,
29+
insertTag,
2930
loadProtectedTailMeta,
3031
openDatabase,
3132
queuePendingOp,
@@ -690,6 +691,15 @@ describe("createTransform", () => {
690691
await transform({}, { messages: firstPass });
691692

692693
const db = openDatabase();
694+
// Push the real tool tag out of the newest-20 skeleton window (the
695+
// db7bc0a tool-skeleton change keeps a truncated tool_use/tool_result
696+
// pair for drops within that window) so this test keeps exercising
697+
// the FULL-removal path it documents. Mirrors padSkeletonWindow in
698+
// apply-operations.tool-drop.test.ts — upstream updated that file's
699+
// tests for the new behavior but missed this one.
700+
for (let i = 1; i <= 20; i += 1) {
701+
insertTag(db, "ses-1", `call-pad-${i}`, "tool", 10, 2 + i);
702+
}
693703
queuePendingOp(db, "ses-1", 1, "drop");
694704
queuePendingOp(db, "ses-1", 2, "drop");
695705
shouldExecute.mockImplementation(() => "execute");

0 commit comments

Comments
 (0)