Merge pull request #2789 from code-yeongyu/fix/2671-clearSessionState
fix(anthropic-recovery): clear session state after successful summarize (fixes #2225)
This commit is contained in:
@@ -98,9 +98,9 @@ describe("runSummarizeRetryStrategy", () => {
|
|||||||
}) as typeof setTimeout
|
}) as typeof setTimeout
|
||||||
|
|
||||||
autoCompactState.retryStateBySession.set(sessionID, {
|
autoCompactState.retryStateBySession.set(sessionID, {
|
||||||
attempt: 1,
|
attempt: 0,
|
||||||
lastAttemptTime: Date.now(),
|
lastAttemptTime: Date.now(),
|
||||||
firstAttemptTime: Date.now() - 119700,
|
firstAttemptTime: Date.now() - 119900,
|
||||||
})
|
})
|
||||||
summarizeMock.mockRejectedValueOnce(new Error("rate limited"))
|
summarizeMock.mockRejectedValueOnce(new Error("rate limited"))
|
||||||
|
|
||||||
@@ -117,6 +117,6 @@ describe("runSummarizeRetryStrategy", () => {
|
|||||||
//#then
|
//#then
|
||||||
expect(timeoutCalls.length).toBe(1)
|
expect(timeoutCalls.length).toBe(1)
|
||||||
expect(timeoutCalls[0]!.delay).toBeGreaterThan(0)
|
expect(timeoutCalls[0]!.delay).toBeGreaterThan(0)
|
||||||
expect(timeoutCalls[0]!.delay).toBeLessThanOrEqual(500)
|
expect(timeoutCalls[0]!.delay).toBeLessThanOrEqual(300)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ export async function runSummarizeRetryStrategy(params: {
|
|||||||
body: summarizeBody as never,
|
body: summarizeBody as never,
|
||||||
query: { directory: params.directory },
|
query: { directory: params.directory },
|
||||||
})
|
})
|
||||||
|
clearSessionState(params.autoCompactState, params.sessionID)
|
||||||
return
|
return
|
||||||
} catch {
|
} catch {
|
||||||
const remainingTimeMs = SUMMARIZE_RETRY_TOTAL_TIMEOUT_MS - (Date.now() - retryState.firstAttemptTime)
|
const remainingTimeMs = SUMMARIZE_RETRY_TOTAL_TIMEOUT_MS - (Date.now() - retryState.firstAttemptTime)
|
||||||
|
|||||||
Reference in New Issue
Block a user