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:
Aurélien Sibiril
2026-04-27 10:03:44 +02:00
parent bdd207a100
commit f715a806ee
2 changed files with 120 additions and 0 deletions

View File

@@ -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)
},
)