Present native PromptKit operation failures

This commit is contained in:
2026-10-26 14:18:21 +00:00
parent 41c6ca8070
commit 3338b902a2
4 changed files with 122 additions and 7 deletions

View File

@@ -27,7 +27,8 @@ type SmokeRequest struct {
// without a builder, the seed is forwarded unchanged. Reports and errors from
// PromptKit are both retained. A nil loader is kept as a suite wiring issue and
// does not install a smoke-test callback. The callback also retains independent
// engine diagnostics and terminal context with the report and error.
// engine diagnostics and terminal context with the report and error. Native
// operation errors supply terminal explanations when structured context is absent.
func WithSmokeTesting[I, S any](
suite Suite[I, S],
load func(context.Context, ckconfig.Selection, I, S) (*promptkit.Engine, error),
@@ -65,6 +66,7 @@ func WithSmokeTesting[I, S any](
}
report, err := engine.SmokeTest(ctx, concreteRequest)
messages = messages.withOperationError(err)
return commandkit.Acquired[*promptkit.SmokeTestReport]{Value: report, Diagnostics: messages.diagnostics, Explanation: messages.explanation}, err
}
return suite