Skip to content

Commit bb91b54

Browse files
committed
Drop the remaining required-limit rules and docs
1 parent f6e7661 commit bb91b54

16 files changed

Lines changed: 32 additions & 55 deletions

File tree

‎apps/daemon/internal/agent/mcode/model_provider_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func TestOptionsRejectInvalidProvider(t *testing.T) {
8989
{"protocol alias", "protocol", "chat-completions"},
9090
{"remote HTTP", "base_url", "http://provider.example/v1"},
9191
{"empty key", "api_key", ""},
92-
{"missing context", "context_window", 0},
92+
{"output without context", "context_window", 0},
9393
{"excess output", "max_output_tokens", 64001},
9494
{"native options", "options", map[string]any{"apiKey": "fixture-key"}},
9595
} {

‎apps/web/e2e/fixture-console.mjs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ function providerProblem(harness, input) {
541541
if (!["anthropic", "responses", "chat_completions"].includes(input.protocol)) return "unsupported model provider protocol";
542542
if (!input.api_key.trim() || Buffer.byteLength(input.api_key) > 16384 || /[\0\r\n]/.test(input.api_key)) return "invalid model provider API key";
543543
if ((input.max_output_tokens ?? 0) > (input.context_window ?? 0)) return "invalid model token limits";
544-
if (harness === "mcode" && !(input.context_window > 0 && input.max_output_tokens > 0)) return "selected harness requires positive model context_window and max_output_tokens";
545544
return null;
546545
}
547546

@@ -550,7 +549,7 @@ function providerProblem(harness, input) {
550549
* (services/core/internal/api/harness_model_providers.go): the list
551550
* reflects every write; an unknown harness or an unset provider is 404; PUT
552551
* takes a JSON object of at most 32 KiB, is a full replacement that needs the
553-
* key every time (mcode also both limits) and answers with the safe view;
552+
* key every time and answers with the safe view;
554553
* DELETE is 204 and safe to repeat. A disabled harness may still be configured.
555554
*/
556555
async function harnessRoute(request, response, path) {

‎apps/web/e2e/system.spec.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ test("sets, replaces and clears a harness's default model configuration, and kee
123123

124124
// A disabled harness may still be configured; token limits are optional.
125125
await mcode.getByRole("button", { name: "Set the default model configuration for MiniMax Code" }).click();
126-
const mcodeSet = page.getByRole("dialog", { name: "Set default model configuration for MiniMax Code" });
127-
await expect(mcodeSet.getByRole("combobox", { name: "Protocol", exact: true })).toHaveText("Anthropic Messages");
128-
await mcodeSet.getByRole("combobox", { name: "Protocol", exact: true }).click();
126+
const limits = page.getByRole("dialog", { name: "Set default model configuration for MiniMax Code" });
127+
await expect(limits.getByRole("combobox", { name: "Protocol", exact: true })).toHaveText("Anthropic Messages");
128+
await limits.getByRole("combobox", { name: "Protocol", exact: true }).click();
129129
await expect(page.getByRole("option")).toHaveText(["Anthropic Messages", "OpenAI Responses", "OpenAI Chat Completions"]);
130130
await page.getByRole("option", { name: "OpenAI Responses", exact: true }).click();
131-
await mcodeSet.getByLabel("Base URL").fill("https://model.example/anthropic");
132-
await mcodeSet.getByLabel("API key").fill(KEY);
133-
await mcodeSet.getByLabel("Default model ID").fill("fixture-model");
134-
await expect(mcodeSet.getByRole("button", { name: "Save" })).toBeEnabled();
135-
await mcodeSet.getByRole("button", { name: "Cancel" }).click();
131+
await limits.getByLabel("Base URL").fill("https://model.example/anthropic");
132+
await limits.getByLabel("API key").fill(KEY);
133+
await limits.getByLabel("Default model ID").fill("fixture-model");
134+
await expect(limits.getByRole("button", { name: "Save" })).toBeEnabled();
135+
await limits.getByRole("button", { name: "Cancel" }).click();
136136
await expect(mcode).toContainText("Not set");
137137

138138
expect(await writes(request)).toEqual([

‎contracts/agents-api/core-errors.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ Each code returns HTTP 400 with `type: "invalid_request_error"`. A missing, malf
6161
| `model_provider_base_url_invalid` | `base_url` | omitted | Requires HTTPS without credentials, query or fragment |
6262
| `model_provider_protocol_unsupported` | `protocol` | `harness` and `allowed_protocols`, from the build's adapter catalog | The protocol is unknown or unsupported by the selected Harness |
6363
| `model_provider_api_key_invalid` | `api_key` | `max_length`: 16384 | The key is empty, too long or contains a prohibited character |
64-
| `model_provider_token_limits_invalid` | `context_window` or `max_output_tokens` | omitted | Limits are invalid, or the Harness requires positive limits that are missing |
64+
| `model_provider_token_limits_invalid` | `context_window` or `max_output_tokens` | omitted | A limit is negative, or `max_output_tokens` exceeds `context_window` (0 when omitted) |
6565
| `model_configuration_model_invalid` | `model` | omitted | The deployment default's model is not a nonempty model identifier |
6666
| `harness_config_invalid` | `harness_config` | omitted | The deployment default's native parameters are unsupported or invalid |
6767
| `invalid_sandbox_configuration` | `resources.cpus` | `min`: 1, `max`: 255 | The CPU count is outside the supported bounds |
6868
| `invalid_sandbox_configuration` | `resources.memory_mib` | `min`: 512, `max`: 1048576 | Memory is outside the supported bounds |
6969
| `invalid_sandbox_configuration` | `resources.root_disk_mib` or `resources.environment_disk_mib` | `min`: 1024 for microsandbox; `min`: 0, `max`: 0 for Docker and E2B | Disk capacity is missing or unsupported by the provider |
7070
| `invalid_sandbox_configuration` | `runtime` | omitted | The Runtime release is missing, mutable, invalid or not allowed for E2B |
7171

72-
Bounds are validation constants, never submitted values. Node names are limited in bytes; Project and key names in trimmed Unicode characters without control characters. Only the first failure is reported, in this order: model provider URL, protocol, key, general limits, the Harness's protocol, then the Harness's required limits; sandbox resources CPU, memory, disk, then Runtime. Model-provider field errors inside a `model_provider` object keep that object's field as `param`. An unknown sandbox provider returns an error without these fields.
72+
Bounds are validation constants, never submitted values. Node names are limited in bytes; Project and key names in trimmed Unicode characters without control characters. Only the first failure is reported, in this order: model provider URL, protocol, key, limits, then the Harness's protocol; sandbox resources CPU, memory, disk, then Runtime. Model-provider field errors inside a `model_provider` object keep that object's field as `param`. An unknown sandbox provider returns an error without these fields.
7373

7474
## Other administration errors
7575

‎contracts/agents-api/zh/core-errors.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Core 管理错误"
33
source: contracts/agents-api/core-errors.md
4-
source_hash: 8fdff312fc4a2140079fca076fd099c4329596f1f12859a6caa1a3b3ad3908fd
4+
source_hash: 73b7865736df763df48d1b419594feec04ef1c05b57e3d8e0c176e54ab336b7c
55
---
66

77
`/core/v1` 上的错误使用此封装结构。`message` 是安全的英文文本;`code` 和 `param` 可以为 null。客户端依据稳定的 `code` 和可选的 `param` 进行处理,对未知代码显示 `message`,绝不解析消息,也绝不自动重试被拒绝的写操作。
@@ -63,15 +63,15 @@ Web 的控制台服务器在 `/core` 路径上发生自身故障时使用此封
6363
| `model_provider_base_url_invalid` | `base_url` | 省略 | 必须使用 HTTPS,且不得包含凭据、查询或片段 |
6464
| `model_provider_protocol_unsupported` | `protocol` | `harness` 和 `allowed_protocols`,来自该构建的适配器目录 | 协议未知,或所选 Harness 不支持该协议 |
6565
| `model_provider_api_key_invalid` | `api_key` | `max_length`:16384 | 密钥为空、过长或包含禁止字符 |
66-
| `model_provider_token_limits_invalid` | `context_window` 或 `max_output_tokens` | 省略 | 限制无效,或 Harness 要求的正数限制缺失 |
66+
| `model_provider_token_limits_invalid` | `context_window` 或 `max_output_tokens` | 省略 | 限制为负数,或 `max_output_tokens` 超过 `context_window`(省略时为 0) |
6767
| `model_configuration_model_invalid` | `model` | 省略 | 部署默认配置的 model 不是非空模型标识符 |
6868
| `harness_config_invalid` | `harness_config` | 省略 | 部署默认配置的原生参数不受支持或无效 |
6969
| `invalid_sandbox_configuration` | `resources.cpus` | `min`:1,`max`:255 | CPU 数量超出支持范围 |
7070
| `invalid_sandbox_configuration` | `resources.memory_mib` | `min`:512,`max`:1048576 | 内存超出支持范围 |
7171
| `invalid_sandbox_configuration` | `resources.root_disk_mib` 或 `resources.environment_disk_mib` | `min`:microsandbox 为 1024;Docker 和 E2B 的 `min`:0,`max`:0 | 磁盘容量缺失或提供商不支持 |
7272
| `invalid_sandbox_configuration` | `runtime` | 省略 | Runtime 版本缺失、可变、无效或 E2B 不允许 |
7373

74-
这些边界是验证常量,绝不是提交的值。节点名称按字节数限制;项目名称和键名称按去除首尾空白后的 Unicode 字符数限制,且不得包含控制字符。系统仅按以下顺序报告第一个失败项:模型提供商 URL、协议、密钥、常规限制、Harness 协议,然后是 Harness 的必需限制;沙箱资源依次为 CPU、内存、磁盘,然后是 Runtime。`model_provider` 对象内的模型提供商字段错误仍以该对象的相应字段作为 `param`。未知的沙箱提供商返回一个不含这些字段的错误。
74+
这些边界是验证常量,绝不是提交的值。节点名称按字节数限制;项目名称和键名称按去除首尾空白后的 Unicode 字符数限制,且不得包含控制字符。系统仅按以下顺序报告第一个失败项:模型提供商 URL、协议、密钥、限制,然后是 Harness 协议;沙箱资源依次为 CPU、内存、磁盘,然后是 Runtime。`model_provider` 对象内的模型提供商字段错误仍以该对象的相应字段作为 `param`。未知的沙箱提供商返回一个不含这些字段的错误。
7575

7676
## 其他管理错误 {#other-administration-errors}
7777

‎docs/api/public-agent-api.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Core runs several Harnesses and accepts your own model access. Those settings ar
145145
| Field | Where | Value |
146146
| --- | --- | --- |
147147
| `harness` | Agent, or a Session's inline `agent` | `codex`, `claude_sdk` or `mcode` |
148-
| `model_provider` | Agent, or Session creation (top level) | `protocol`, `base_url`, `api_key`, and for `mcode` also `context_window` and `max_output_tokens`. The protocol must be one of the Harness's native protocols |
148+
| `model_provider` | Agent, or Session creation (top level) | `protocol`, `base_url`, `api_key`, and optionally `context_window` and `max_output_tokens`. The protocol must be one of the Harness's native protocols |
149149
| `harness_config` | Agent, inline `agent`, or Session creation (top level, wins) | The Harness's native model parameters, such as Claude Code's `thinking` |
150150
| `environment` | `openai_hosted` or `self_hosted` Session creation (top level) | Portable preparation: `environment_template_id`, `files`, `env`, `packages`, `setup_commands`, `skills`, `plugins`, `capability_directories`. A field may not also appear in `environment`; see [Environments](../../contracts/agents-api/environments.md#preparation-order) |
151151
| `installation` | Read-only, on `self_hosted` Sessions | Short-lived install commands for your machine; see [Run self-hosted Sessions](../getting-started/self-hosted.md) |

‎docs/getting-started/install.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The installer selects no sandbox backend. [Choose a sandbox backend](./sandbox-b
8383
Core-hosted Sessions that bring no model provider use their Harness's default model. See [default models](../configuration.md#default-models).
8484

8585
1. Open **Settings → Models and credentials**. Under **Default model configuration**, the Harness marked **Default** shows **Model provider not set**. It is Codex unless you changed `OAC_DEFAULT_HARNESS`; see [settings](../configuration.md#settings).
86-
2. Choose **Set** and enter the model ID, the protocol, and the provider's base URL and API key. MiniMax Code also needs the context window and the maximum output tokens.
86+
2. Choose **Set** and enter the model ID, the protocol, and the provider's base URL and API key.
8787
3. Save. The Harness shows **Ready**.
8888

8989
## Issue a Project API key

‎docs/zh/api/public-agent-api.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Agents API 指南"
33
source: docs/api/public-agent-api.md
4-
source_hash: 47c626b6be9a45d18e566d17556321a484356e825e0d5f0dd07385ccd6e50496
4+
source_hash: 83f4c5d7c0e5c748087e6baa51c792a7cd831e217b47980c65db7d04e9222140
55
---
66

77
Core 在 `/v1` 提供 OpenAI Agents API。本指南用官方 OpenAI SDK 和普通 HTTP 两种方式演示每项常见任务,并说明 Core 与 OpenAI 的差异。如果尚未启动过 Session,请先阅读[运行第一个 Session](../getting-started/quickstart.md)。
@@ -147,7 +147,7 @@ Core 可以运行多种 Harness,并允许接入你自己的模型访问方式
147147
| 字段 | 所在位置 | 值 |
148148
| --- | --- | --- |
149149
| `harness` | Agent,或 Session 的内联 `agent` | `codex`、`claude_sdk` 或 `mcode` |
150-
| `model_provider` | Agent,或 Session 创建请求(顶层) | `protocol`、`base_url`、`api_key`;对于 `mcode`,还包括 `context_window` 和 `max_output_tokens`。协议必须是该 Harness 的原生协议之一 |
150+
| `model_provider` | Agent,或 Session 创建请求(顶层) | `protocol`、`base_url`、`api_key`,以及可选的 `context_window` 和 `max_output_tokens`。协议必须是该 Harness 的原生协议之一 |
151151
| `harness_config` | Agent、内联 `agent`,或 Session 创建请求(顶层,优先) | Harness 的原生模型参数,例如 Claude Code 的 `thinking` |
152152
| `environment` | `openai_hosted` 或 `self_hosted` Session 创建请求(顶层) | 可移植的准备配置:`environment_template_id`、`files`、`env`、`packages`、`setup_commands`、`skills`、`plugins`、`capability_directories`。同一字段不能也出现在 `environment` 中;请参阅 [Environments](../../../contracts/agents-api/zh/environments.md#preparation-order) |
153153
| `installation` | 只读,适用于 `self_hosted` Session | 在你的计算机上运行的短期安装命令;请参阅 [运行自托管 Session](../getting-started/self-hosted.md) |

‎docs/zh/getting-started/install.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "安装 Core 和 Web"
33
source: docs/getting-started/install.md
4-
source_hash: 6bde0267753b797a6ada321509d9ac4ab2270021069308f4f07bb33c9d3e03cd
4+
source_hash: e638457e86e53dac6f049c96e1a1dbd91646a26b1b6179f90c5b39f8750425b5
55
---
66

77
本指南带运维人员从一台空主机到可用的安装:在 Docker 下运行的 Core、Web 控制台和 PostgreSQL,一个沙箱提供商,一个默认模型和第一个项目 API 密钥。Web 的 **概览** 通过 **新手引导** 清单跟踪同样的步骤。
@@ -85,7 +85,7 @@ curl -fsSL https://openagentcore.dev/install.sh | bash -s -- --public-url https:
8585
没有自带模型提供商的 Core 托管 Session 使用其 Harness 的默认模型。参阅[默认模型](../configuration.md#default-models)。
8686

8787
1. 打开 **设置 → 模型与凭据**。在 **默认模型配置** 下,标记为 **默认** 的 Harness 显示 **未设置模型提供商**。除非修改了 `OAC_DEFAULT_HARNESS`,否则为 Codex,参阅[设置](../configuration.md#settings)。
88-
2. 选择 **设置**,输入模型 ID、协议以及提供商的基础 URL 和 API 密钥。MiniMax Code 还需要上下文窗口和最大输出 token 数。
88+
2. 选择 **设置**,输入模型 ID、协议以及提供商的基础 URL 和 API 密钥。
8989
3. 保存。该 Harness 显示 **就绪**。
9090

9191
## 签发项目 API 密钥 {#issue-a-project-api-key}

0 commit comments

Comments
 (0)