From 5a9cf0896bb3ca041eaf79d922e7c74344de3b4f Mon Sep 17 00:00:00 2001 From: Jeff Rose Date: Thu, 15 Jan 2026 23:22:47 -0800 Subject: [PATCH 1/2] Apply suggested fix to plugins/command/plugin.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- plugins/command/plugin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/command/plugin.go b/plugins/command/plugin.go index 8153461..d181b8a 100644 --- a/plugins/command/plugin.go +++ b/plugins/command/plugin.go @@ -99,7 +99,7 @@ func (p *commandPlugin) Check(ctx context.Context, config regletsdk.Config) (reg Args: args, Dir: cfg.Dir, Env: cfg.Env, - Timeout: cfg.Timeout, + Timeout: time.Duration(cfg.Timeout) * time.Second, }) if err != nil { return regletsdk.Failure("exec", fmt.Sprintf("execution failed: %v", err)), nil From 42017fbd89610824428e41479d54b3a2c9c20537 Mon Sep 17 00:00:00 2001 From: Jeff Rose Date: Thu, 15 Jan 2026 23:22:47 -0800 Subject: [PATCH 2/2] Apply suggested fix to plugins/command/plugin.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- plugins/command/plugin.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/command/plugin.go b/plugins/command/plugin.go index d181b8a..8238423 100644 --- a/plugins/command/plugin.go +++ b/plugins/command/plugin.go @@ -35,7 +35,11 @@ type CommandConfig struct { Args []string `json:"args,omitempty" description:"Arguments"` Dir string `json:"dir,omitempty" description:"Working directory"` Env []string `json:"env,omitempty" description:"Environment variables"` - Timeout int `json:"timeout,omitempty" default:"30" description:"Execution timeout in seconds"` + // Timeout is the effective execution timeout. + // It is derived from TimeoutSeconds (in seconds) after configuration validation. + Timeout time.Duration `json:"-" description:"Execution timeout"` + // TimeoutSeconds is the JSON-configurable timeout in seconds. + TimeoutSeconds int `json:"timeout,omitempty" default:"30" description:"Execution timeout in seconds"` } // Schema returns the JSON schema for the plugin's configuration. @@ -53,6 +57,12 @@ func (p *commandPlugin) Check(ctx context.Context, config regletsdk.Config) (reg }, nil } + // Derive the effective timeout as a time.Duration. + if cfg.TimeoutSeconds <= 0 { + cfg.TimeoutSeconds = 30 + } + cfg.Timeout = time.Duration(cfg.TimeoutSeconds) * time.Second + // Validate mutual exclusivity if cfg.Run == "" && cfg.Command == "" { return regletsdk.Evidence{