Strengthen ctx-cancel test coverage
Two additions: - agent_test.go's "context cancellation triggers graceful suspend" now also asserts the input messages land in the suspension checkpoint — verifies the embedded-Checkpoint path that fires when no Checkpointer is configured. - cancel_test.go gets a third subtest that parks the LLM provider inside ChatCompletion via a release channel, cancels ctx while the call is in flight, then confirms the LLM call still saw a non-cancelled ctx and the just-completed turn lands in the persisted checkpoint. Proves the framework's WithoutCancel shielding works end-to-end at the unit level. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -504,6 +504,7 @@ func TestRun(t *testing.T) {
|
||||
require.ErrorAs(t, err, &se)
|
||||
require.NotNil(t, se.Checkpoint)
|
||||
assert.Equal(t, agent.AgentStatusSuspended, se.Checkpoint.Status)
|
||||
assert.NotEmpty(t, se.Checkpoint.Messages, "the input messages must land in the suspension checkpoint")
|
||||
assert.Equal(t, 0, provider.calls)
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user