fix(todo-continuation): cancel stale ULW countdown
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -67,4 +67,35 @@ describe("handleNonIdleEvent", () => {
|
||||
expect(state.wasCancelled).toBe(true)
|
||||
expect(state.tokenLimitDetected).toBe(true)
|
||||
})
|
||||
|
||||
test("given ultrawork loop continuation user message update, cancels stale todo continuation countdown", () => {
|
||||
// given
|
||||
const sessionID = "ses_ulw_todo_overlap"
|
||||
const state = sessionStateStore.getState(sessionID)
|
||||
state.countdownStartedAt = Date.now() - 10_000
|
||||
state.wasCancelled = true
|
||||
state.tokenLimitDetected = true
|
||||
|
||||
// when
|
||||
handleNonIdleEvent({
|
||||
eventType: "message.updated",
|
||||
properties: {
|
||||
sessionID,
|
||||
info: { role: "user" },
|
||||
parts: [
|
||||
{
|
||||
type: "text",
|
||||
text: `ultrawork [SYSTEM DIRECTIVE: OH-MY-OPENCODE - RALPH LOOP 2/500]\ncontinue\n${OMO_INTERNAL_INITIATOR_MARKER}`,
|
||||
synthetic: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
sessionStateStore,
|
||||
})
|
||||
|
||||
// then
|
||||
expect(state.countdownStartedAt).toBeUndefined()
|
||||
expect(state.wasCancelled).toBe(true)
|
||||
expect(state.tokenLimitDetected).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user