Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Model providers are not process settings; see [Default models](#default-models).
| `OAC_EXECUTION_CONCURRENCY` | `4` | Concurrent execution work, from 1 to 1024 |
| `OAC_SANDBOX_MAX_ACTIVE` | `100` | Active sandbox limit for direct Providers with suspension, from 1 to 100000. Independent of execution concurrency and node capacity |
| `OAC_SANDBOX_MAX_RETAINED` | `400` | Retained sandbox limit for direct Providers, from 1 to 100000, including active, suspended and unconfirmed cleanup. Must be at least the active limit |
| `OAC_TURN_AUTO_RETRIES` | `0` | Automatic retries of a Turn that failed on a recoverable model or tool error, from 0 to 5. `0` turns it off |
| `OAC_TURN_AUTO_RETRIES` | `3` | Automatic retries of a Turn that failed on a recoverable model or tool error, from 0 to 5. `0` turns it off |
| `OAC_DEFAULT_HARNESS` | `codex` | Harness used when a request does not name one |
| `OAC_HARNESSES` | Every registered Harness | Comma-separated Harnesses to enable besides the default one. Unknown names stop startup |
| `OAC_WRITE_AUDIT_RETENTION` | `2160h` | Minimum `1h` |
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "配置参考"
source: docs/configuration.md
source_hash: 9b3a2b1e7dcc2e742b252ebd700a088be56416ee0a293e78a79730df026b3576
source_hash: e62a7ce6fb3c56f6522cb3444c8c5391a872ae12895122aca4cbf299e96f2c15
---

Core 安装的每项设置都恰好只有一个归属位置,分属以下三类:
Expand Down Expand Up @@ -57,7 +57,7 @@ Core 安装的每项设置都恰好只有一个归属位置,分属以下三类
| `OAC_EXECUTION_CONCURRENCY` | `4` | Concurrent execution work, from 1 to 1024 |
| `OAC_SANDBOX_MAX_ACTIVE` | `100` | 启用暂停能力的直接 Provider 的活跃沙箱上限,范围 1–100000;独立于执行并发度和节点容量 |
| `OAC_SANDBOX_MAX_RETAINED` | `400` | 直接 Provider 的保留沙箱上限,范围 1–100000,包括活跃、已暂停以及尚未确认清理完成的分配;必须不小于活跃上限 |
| `OAC_TURN_AUTO_RETRIES` | `0` | Turn 因可恢复的模型或工具错误失败后的自动重试次数,0 到 5。`0` 表示关闭 |
| `OAC_TURN_AUTO_RETRIES` | `3` | Turn 因可恢复的模型或工具错误失败后的自动重试次数,0 到 5。设为 `0` 关闭 |
| `OAC_DEFAULT_HARNESS` | `codex` | Harness used when a request does not name one |
| `OAC_HARNESSES` | Every registered Harness | Comma-separated Harnesses to enable besides the default one. Unknown names stop startup |
| `OAC_WRITE_AUDIT_RETENTION` | `2160h` | Minimum `1h` |
Expand Down
3 changes: 3 additions & 0 deletions services/core/internal/execution/turn_retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
"github.com/MiniMax-AI/OpenAgentCore/services/core/internal/sessions"
)

// DefaultTurnAutoRetries is the OAC_TURN_AUTO_RETRIES value used when it is unset or empty.
const DefaultTurnAutoRetries = 3

// MaxTurnAutoRetries bounds OAC_TURN_AUTO_RETRIES; zero turns the feature off.
const MaxTurnAutoRetries = 5

Expand Down
4 changes: 2 additions & 2 deletions services/core/internal/processconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (c Config) Settings() []api.InstallationSetting {
setting("OAC_LOG_FORMAT", format, "auto", []api.InstallationService{api.InstallationCore, api.InstallationWeb}),
setting("OAC_LOG_ADD_SOURCE", c.Log.AddSource, false, []api.InstallationService{api.InstallationCore, api.InstallationWeb}),
setting("OAC_EXECUTION_CONCURRENCY", c.ExecutionConcurrency, execution.DefaultExecutionConcurrency, []api.InstallationService{api.InstallationCore}),
setting("OAC_TURN_AUTO_RETRIES", c.TurnAutoRetries, 0, []api.InstallationService{api.InstallationCore}),
setting("OAC_TURN_AUTO_RETRIES", c.TurnAutoRetries, execution.DefaultTurnAutoRetries, []api.InstallationService{api.InstallationCore}),
setting("OAC_HARNESSES", c.Harnesses, (engine.Catalog{}).Kinds(), []api.InstallationService{api.InstallationCore}),
setting("OAC_DEFAULT_HARNESS", c.DefaultHarness, defaultHarness, []api.InstallationService{api.InstallationCore}),
setting("OAC_WRITE_AUDIT_RETENTION", duration(c.WriteAuditRetention), duration(defaultWriteAuditRetention), []api.InstallationService{api.InstallationCore}),
Expand Down Expand Up @@ -279,7 +279,7 @@ func executionConcurrency() (int, error) {
func turnAutoRetries() (int, error) {
value := os.Getenv("OAC_TURN_AUTO_RETRIES")
if value == "" {
return 0, nil
return execution.DefaultTurnAutoRetries, nil
}
limit, err := strconv.Atoi(value)
if err != nil || limit < 0 || limit > execution.MaxTurnAutoRetries {
Expand Down
7 changes: 5 additions & 2 deletions services/core/internal/processconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func TestSettingsReportEffectiveValuesAndHideHistory(t *testing.T) {
if setting.Key == "OAC_WRITE_AUDIT_RETENTION" && setting.Default != "2160h" {
t.Fatal(setting.Default)
}
if setting.Key == "OAC_TURN_AUTO_RETRIES" && setting.Default != 3 {
t.Fatal(setting.Default)
}
if setting.Key == "OAC_HISTORY_SETTINGS_FILE" && (setting.Configured == nil || !*setting.Configured) {
t.Fatal("history file was not reported as configured")
}
Expand All @@ -234,10 +237,10 @@ func TestSettingsReportEffectiveValuesAndHideHistory(t *testing.T) {

func TestTurnAutoRetries(t *testing.T) {
required(t)
if c, err := Load(); err != nil || c.TurnAutoRetries != 0 {
if c, err := Load(); err != nil || c.TurnAutoRetries != 3 {
t.Fatal(c.TurnAutoRetries, err)
}
for value, want := range map[string]int{"0": 0, "3": 3, "5": 5} {
for value, want := range map[string]int{"": 3, "0": 0, "3": 3, "5": 5} {
t.Setenv("OAC_TURN_AUTO_RETRIES", value)
if c, err := Load(); err != nil || c.TurnAutoRetries != want {
t.Fatal(value, c.TurnAutoRetries, err)
Expand Down