Documentation
¶
Overview ¶
Package constants consolidates tunable system parameters: timeouts, intervals, retry counts, size limits, concurrency caps, and pagination defaults used across the wallfacer backend.
Package constants provides consolidated tunable system parameters used throughout wallfacer.
Rather than scattering magic numbers across packages, all timeouts, polling intervals, retry counts, size limits, concurrency caps, cache TTLs, and pagination defaults are defined here. This makes it easy to audit and adjust system behavior from a single location. Some values are declared as variables (not constants) to allow test overrides.
Connected packages ¶
Consumed by nearly every internal package: [runner], [handler], [store], [cli], and [logger]. Changing a constant here has system-wide impact — verify all call sites before modifying a value. grep for the constant name to find all consumers.
Usage ¶
timeout := constants.DefaultTaskTimeout ticker := time.NewTicker(constants.AutoPromoteInterval)
Index ¶
Constants ¶
const ( BodyLimitDefault int64 = 1 << 20 // 1 MiB BodyLimitInstructions int64 = 5 << 20 // 5 MiB BodyLimitFeedback int64 = 512 << 10 // 512 KiB )
Request body size limits.
const ( DefaultRetryHistoryLimit = 10 DefaultRefineSessionsLimit = 5 DefaultPromptHistoryLimit = 20 )
DefaultRetryHistoryLimit, DefaultRefineSessionsLimit, and DefaultPromptHistoryLimit cap the number of entries persisted for the three unboundedly-growing task slice fields.
const AutoPromoteInterval = 60 * time.Second
AutoPromoteInterval is the periodic ticker interval for the auto-promoter.
const AutoRefineInterval = 30 * time.Second
AutoRefineInterval is the polling interval for the auto-refine watcher.
const AutoSubmitInterval = 30 * time.Second
AutoSubmitInterval is the polling interval for the auto-submit watcher.
const AutoTestInterval = 30 * time.Second
AutoTestInterval is the polling interval for the auto-test watcher.
const ChurnLookbackDays = 90
ChurnLookbackDays only includes commits newer than this many days.
const CommitsBehindCacheTTL = 20 * time.Second
CommitsBehindCacheTTL is the time-to-live for cached CommitsBehind results.
const ContainerPollInterval = 5 * time.Second
ContainerPollInterval is the polling interval for container health monitoring.
const CurrentTaskSchemaVersion = 2
CurrentTaskSchemaVersion is the on-disk schema version for task.json.
const DefaultArchivedTasksPerPage = 20
DefaultArchivedTasksPerPage is the pagination size for archived task listings.
const DefaultCBThreshold = 5
DefaultCBThreshold is the number of consecutive container launch failures required to open the circuit breaker.
const DefaultIdeationExploitRatio = 0.8
DefaultIdeationExploitRatio is the default exploit/explore balance for ideation.
const DefaultIdeationImpactScore = 60
DefaultIdeationImpactScore is the default impact score threshold for ideation.
const DefaultIdeationInterval = 60 * time.Minute
DefaultIdeationInterval is the default interval between ideation brainstorm runs.
const DefaultMaxConcurrentTasks = 5
DefaultMaxConcurrentTasks is the default parallel task limit.
const DefaultMaxTestConcurrentTasks = 2
DefaultMaxTestConcurrentTasks is the default parallel test-run limit.
const DefaultMaxTurnOutputBytes = 8 * 1024 * 1024 // 8 MB
DefaultMaxTurnOutputBytes is the default per-turn stdout/stderr output size budget. Outputs exceeding this limit are truncated server-side.
const DefaultTaskTimeout = 60 * time.Minute
DefaultTaskTimeout is the default timeout for task execution.
const DefaultTombstoneRetentionDays = 7
DefaultTombstoneRetentionDays is the default number of days before pruning soft-deleted tasks.
const DefaultWorktreeGCInterval = 24 * time.Hour
DefaultWorktreeGCInterval is the interval between worktree garbage collection runs.
const DefaultWorktreeHealthInterval = 2 * time.Minute
DefaultWorktreeHealthInterval is the interval between worktree health checks.
const DiffCacheTTL = 10 * time.Second
DiffCacheTTL is the time-to-live for cached diff entries for non-terminal tasks.
const FetchErrorGracePeriod = 5 * time.Minute
FetchErrorGracePeriod is how long after a fetch error before retrying.
const FileIndexTTL = 30 * time.Second
FileIndexTTL is the time-to-live for a cached workspace file list.
const IdeaAgentDefaultTimeout = 60
IdeaAgentDefaultTimeout is the default timeout (minutes) for idea-agent task cards.
const LogValueMaxLen = 200
LogValueMaxLen is the maximum length for value truncation in pretty logging.
const MaxAutoRetries = 3
MaxAutoRetries is the global cap on automatic retries per task across all failure categories and retry paths (runner and handler).
const MaxBoardManifestBytes = 64 * 1024
MaxBoardManifestBytes is the maximum size for a board manifest JSON.
const MaxChurnCommits = 200
MaxChurnCommits is the hard cap so very active repos don't scan unboundedly.
const MaxCommitSubjectRunes = 72 - len("wallfacer: ")
MaxCommitSubjectRunes is the maximum number of runes allowed in the commit message subject line (after the "wallfacer: " prefix).
const MaxDiffBytes = 16000
MaxDiffBytes is the maximum number of bytes to include from the git diff in the test prompt.
const MaxFileListSize = 8000
MaxFileListSize caps the total number of files returned to keep responses fast.
const MaxIdeationChurnSignals = 6
MaxIdeationChurnSignals is the maximum number of churn signals collected.
const MaxIdeationIdeas = 3
MaxIdeationIdeas is the maximum number of ideas generated per ideation run.
const MaxIdeationTodoSignals = 6
MaxIdeationTodoSignals is the maximum number of TODO signals collected.
const MaxImmutableDiffEntries = 256
MaxImmutableDiffEntries caps the number of retained terminal-task diff entries.
const MaxOversightLogBytes = 40000
MaxOversightLogBytes caps the total log size to avoid exceeding prompt limits.
const MaxRebaseRetries = 3
MaxRebaseRetries is the maximum number of rebase attempts before giving up.
const MaxSearchResults = 50
MaxSearchResults caps the number of task search results returned.
const MaxTailLines = 15
MaxTailLines is the number of tail lines checked for test verdict detection.
const MaxTestFailRetries = 3
MaxTestFailRetries is the maximum number of consecutive test failures before the auto-resume cycle is halted.
const RefinementRecentCompleteWindow = 500 * time.Millisecond
RefinementRecentCompleteWindow is the grace window for clearing a refinement job that has just finished, allowing async startup/failure races to settle.
const RefinementTimeout = 30 * time.Minute
RefinementTimeout is the maximum time allowed for a refinement agent run.
const SnippetPadding = 60
SnippetPadding is the number of context characters shown on each side of a search match in task search results.
const WaitingSyncInterval = 30 * time.Second
WaitingSyncInterval is the polling interval for syncing waiting tasks.
const WorkspaceIdeationCommandTTL = 2 * time.Second
WorkspaceIdeationCommandTTL is the timeout for workspace-scanning shell commands during ideation.
Variables ¶
var SSEKeepaliveInterval = 15 * time.Second
SSEKeepaliveInterval controls how often SSE streams send keepalive comments to prevent proxy and OS-level TCP idle timeouts from silently closing the connection. Tests can lower this for faster verification.
var WatcherSettleDelay = 1500 * time.Millisecond
WatcherSettleDelay is the pause after receiving a wake signal before calling the action. Tests can lower this for faster verification.
Functions ¶
This section is empty.
Types ¶
This section is empty.