refactor(core): simplify compaction recovery

This commit is contained in:
Aiden Cline 2026-07-09 19:06:18 -05:00
commit fb5726baa8
2 changed files with 2 additions and 26 deletions

View file

@ -1623,28 +1623,6 @@ describe("SessionRunnerLLM", () => {
}),
)
it.effect("rejects a manual compaction truncated by the model output limit", () =>
Effect.gen(function* () {
const session = yield* setup
response = reply.text("Earlier answer", "text-manual-length-history")
yield* admit(session, "Earlier question")
yield* session.resume(sessionID)
response = [
LLMEvent.textDelta({ id: "summary", text: "Partial summary" }),
LLMEvent.finish({ reason: "length" }),
]
const compaction = yield* session.compact({ sessionID })
yield* session.resume(sessionID)
expect((yield* session.messages({ sessionID })).find((message) => message.id === compaction.id)).toMatchObject({
type: "compaction",
status: "failed",
error: { type: "compaction.failed", message: "Compaction reached the model output limit" },
})
}),
)
it.effect("settles an admitted manual compaction when pre-start resolution throws", () =>
Effect.gen(function* () {
const session = yield* setup
@ -1770,7 +1748,7 @@ describe("SessionRunnerLLM", () => {
}),
)
it.effect("recovers from provider context overflow despite an undersized configured limit", () =>
it.effect("recovers from provider context overflow despite an undersized configured context limit", () =>
Effect.gen(function* () {
const session = yield* setupOverflowRecovery
currentModel = undersizedContextModel
@ -1783,7 +1761,6 @@ describe("SessionRunnerLLM", () => {
yield* session.resume(sessionID)
expect(requests).toHaveLength(3)
expect(requests[1].generation?.maxTokens).toBe(1_000)
expect(yield* session.context(sessionID)).toMatchObject([
{ type: "compaction", summary: "## Objective\n- Recover undersized limit" },
{ type: "assistant", finish: "stop" },