summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 9e065b5..19548af 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -166,6 +166,13 @@ type SchedulerConfig struct {
// PollIntervalSeconds is how often the scheduler checks for role-typed
// FAILED tasks to retry or escalate. Defaults to 30 when zero/unset.
PollIntervalSeconds int `toml:"poll_interval_seconds"`
+ // AskUserTimeoutSeconds is how long a role-typed task may sit BLOCKED on
+ // an unanswered ask_user question before the scheduler resumes it itself
+ // with a system-authored fallback answer (escalating to the next tier of
+ // the role's ladder where possible) and flags it tasks.needs_review for
+ // a human to double-check later. Defaults to 600 (10 minutes) when
+ // zero/unset.
+ AskUserTimeoutSeconds int `toml:"ask_user_timeout_seconds"`
}
// PollInterval returns the configured poll interval, defaulting to 30s.
@@ -176,6 +183,21 @@ func (c SchedulerConfig) PollInterval() time.Duration {
return time.Duration(c.PollIntervalSeconds) * time.Second
}
+// AskUserTimeout returns the configured ask-user timeout, defaulting to 10
+// minutes when zero/unset. Ten minutes is long enough that a human actively
+// working alongside the agent (this is a self-hosted, typically
+// single-operator system, not a large on-call team watching a queue) has a
+// realistic chance to notice a clarification request and answer it, but
+// short enough that a role-typed task doesn't sit stalled for hours — often
+// the common case, not the exception, in this deployment shape — waiting on
+// input that may never come.
+func (c SchedulerConfig) AskUserTimeout() time.Duration {
+ if c.AskUserTimeoutSeconds <= 0 {
+ return 10 * time.Minute
+ }
+ return time.Duration(c.AskUserTimeoutSeconds) * time.Second
+}
+
func Default() (*Config, error) {
home, err := os.UserHomeDir()
if err != nil {