summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/action_diagnostics.go
blob: bb2c4127dd25a8e88240f9c34283a6a1771aacc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package hexaiaction

import "context"

func init() {
	registerActionHandler(ActionDiagnostics, actionHandlerFunc(handleDiagnosticsActionRequest))
}

func handleDiagnosticsActionRequest(ctx context.Context, req actionRequest) (string, error) {
	return handleDiagnosticsAction(ctx, req.parts, req.cfg, req.client)
}

func handleDiagnosticsAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) {
	return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) {
		return runDiagnostics(cctx, cfg, client, parts.Diagnostics, parts.Selection)
	})
}