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
4 changes: 3 additions & 1 deletion apps/web/src/i18n/locales/en/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const diagnostics = {
server_error: "The model provider reported a server error.",
invalid_request: "The model provider rejected the request.",
resource_not_found: "The model provider could not find the model.",
request_timeout: "The model provider request timed out.",
context_length_exceeded: "The input exceeds the model's context limit.",
cyber_policy: "The model provider rejected the input under its safety policy.",
connection_failed: "The connection to the model provider failed.",
Expand All @@ -43,6 +44,7 @@ export const diagnostics = {
server_error: "Retry later.",
invalid_request: "Check the model and parameters, starting with the model on the Session page. Without a model provider set on the Session or its saved Agent, a hosted sandbox Session uses the default in Settings → Models and credentials.",
resource_not_found: "Check the model on the Session page. Without a model provider set on the Session or its saved Agent, a hosted sandbox Session uses the default in Settings → Models and credentials.",
request_timeout: "Retry later.",
context_length_exceeded: "Start a new Session or shorten the input.",
cyber_policy: "Change the input before sending it again, or start a new Session.",
connection_failed: "Check the Base URL of the Session's model provider. Without one set on the Session or its saved Agent, a hosted sandbox Session uses the default in Settings → Models and credentials.",
Expand All @@ -59,7 +61,7 @@ export const diagnostics = {
exitCode: "Exit code {{code}}.",
httpStatus: "HTTP {{status}}.",
unreachableHost: "Then check that the URL's host resolves and is reachable from the Session's sandbox, or from the host of a self-hosted Session.",
step: { setup: "setup", python: "Python dependencies", npm: "npm dependencies", file: "file preparation", skill: "Skill preparation" },
step: { setup: "setup", python: "Python dependencies", npm: "npm dependencies", file: "file preparation", skill: "Skill preparation", harness: "Harness preparation" },
unavailable: "Failure details unavailable",
unavailableHelp: "The diagnostics read failed or no longer matches this status. Refresh to check again.",
checking: "Checking failure details",
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/i18n/locales/zh-CN/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const diagnostics = {
server_error: "模型提供商发生了服务器错误。",
invalid_request: "模型提供商拒绝了请求。",
resource_not_found: "模型提供商找不到该模型。",
request_timeout: "模型提供商请求超时。",
context_length_exceeded: "输入超出模型的上下文上限。",
cyber_policy: "模型提供商因安全策略拒绝了输入。",
connection_failed: "与模型提供商的连接失败。",
Expand All @@ -43,6 +44,7 @@ export const diagnostics = {
server_error: "请稍后重试。",
invalid_request: "请检查模型和参数,先看 Session 页显示的模型。Session 及其保存的 Agent 都未设置模型提供商时,托管沙箱 Session 使用“设置 → 模型与凭据”中的默认配置。",
resource_not_found: "请检查 Session 页显示的模型。Session 及其保存的 Agent 都未设置模型提供商时,托管沙箱 Session 使用“设置 → 模型与凭据”中的默认配置。",
request_timeout: "请稍后重试。",
context_length_exceeded: "请新建 Session 或缩短输入。",
cyber_policy: "请修改输入后再发送,或新建 Session。",
connection_failed: "请检查该 Session 所用模型提供商的 Base URL。Session 及其保存的 Agent 都未设置模型提供商时,托管沙箱 Session 使用“设置 → 模型与凭据”中的默认配置。",
Expand All @@ -59,7 +61,7 @@ export const diagnostics = {
exitCode: "退出码 {{code}}。",
httpStatus: "HTTP {{status}}。",
unreachableHost: "再确认 Session 的沙箱(自托管 Session 则为其主机)能解析并访问该 URL 的主机。",
step: { setup: "设置", python: "Python 依赖", npm: "npm 依赖", file: "文件准备", skill: "Skill 准备" },
step: { setup: "设置", python: "Python 依赖", npm: "npm 依赖", file: "文件准备", skill: "Skill 准备", harness: "Harness 准备" },
unavailable: "失败详情不可用",
unavailableHelp: "诊断读取失败或与当前状态不一致,请刷新后重试。",
checking: "正在读取失败详情",
Expand Down
1 change: 1 addition & 0 deletions contracts/agents-api/core-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ The [Session diagnostics](./session-diagnostics.md) routes return these categori
| `server_error` | Native server failure classification |
| `invalid_request` | Native request rejection |
| `resource_not_found` | Native resource/model not found |
| `request_timeout` | Native provider timeout classification |
| `context_length_exceeded` | Native context limit classification |
| `cyber_policy` | Native cyber policy rejection |
| `connection_failed` | Native connection failure; params contain `http_status`, an integer in 100–599 or null |
Expand Down
4 changes: 4 additions & 0 deletions contracts/agents-api/core.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ definitions:
- server_error
- invalid_request
- resource_not_found
- request_timeout
- context_length_exceeded
- cyber_policy
- connection_failed
Expand Down Expand Up @@ -831,6 +832,7 @@ definitions:
- server_error
- invalid_request
- resource_not_found
- request_timeout
- context_length_exceeded
- cyber_policy
- connection_failed
Expand Down Expand Up @@ -1746,6 +1748,7 @@ definitions:
- server_overloaded
- server_error
- resource_not_found
- request_timeout
- invalid_request
type: string
x-enum-varnames:
Expand All @@ -1756,6 +1759,7 @@ definitions:
- ProviderServerOverloaded
- ProviderServerError
- ProviderResourceNotFound
- ProviderRequestTimeout
- ProviderInvalidRequest
modelprovider.Protocol:
enum:
Expand Down
4 changes: 2 additions & 2 deletions contracts/agents-api/harness-onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Before starting, record the operation set, expected results, exclusions and stop

1. **Contract tests.** Call `agent/contracttest.TextLifecycle` from a test named `TestSharedTextLifecycle` with the adapter's prepared Executor and a deterministic native fixture; `claudesdk/executor_test.go` is the reference. It checks independent Turn streams, native owner and history continuity, durable write and application receipts, stale cancellation and healthy continuation after cancellation. `make check-runtime-contract` runs it together with the shared wire, gateway, transport and dispatcher tests, the declaration completeness check and each adapter's `TestUnsupportedExtensionsHaveNoNativeEffects`. Adapter tests also cover two ordinary Turns sharing one native process or connection and history, cancellation followed by another Turn, stale cancellation and late events, native exit, cleanup failure, input write and application receipts, unknown outcomes and fresh per-Turn usage, function, input and child-observation state. State whether a fixture is controlled or a real provider.
2. **Shared integration.** `TestThirdHarnessPublicOnboarding` runs the synthetic Harness through public Session and input admission, Worker device selection, the real WebSocket gateway, the daemon Registry and Router, neutral events and durable terminal projection. It uses a custom immutable registry in the same `execution.Policy` given to the API handler and the dispatcher, and checks applied input receipts, saved native identity, continuation, cancellation, unsupported optional requests and missing mandatory Runtime support. The fixture has no workspace, MCP or public functions, and its registration stays local to the test. It proves the integration path, not native execution.
3. **Real acceptance.** Use the pinned official Python SDK and raw HTTP against Core, a real provider API, the native Harness and a dedicated database. Verify initial execution, a warm follow-up, cancellation and restart with continuation; record native owner identity and same-condition cold and warm timing. For workspace placements also verify Files and Artifacts, workspace identity, that no credentials appear in public responses and that foreign history is rejected. `services/core/tests/official_hosted_functions_native.py` holds the shared function assertions: success and error, native file output and public Artifact bytes, same-history continuation after restart, foreign result rejection and pending-call cancellation. Synthetic or failed runs never count. The opt-in tests below run the pinned-SDK fixtures in `services/core/tests` against a real daemon and model; each runs when `OAC_TEST_OFFICIAL_SDK_PYTHON`, `OAC_TEST_NATIVE_DAEMON_BIN`, `OAC_TEST_NATIVE_PROOF_DIR` and its private options file are set. The options file is a JSON object with exactly `model` and `model_provider` (the fields of `x_agents_core.model_provider`); the test sets it as the deployment default model provider, which the fixtures' `environment: none` Sessions freeze at creation.
3. **Real acceptance.** Use the pinned official Python SDK and raw HTTP against Core, a real provider API, the native Harness and a dedicated database. Verify initial execution, a warm follow-up, cancellation and restart with continuation; record native owner identity and same-condition cold and warm timing. For workspace placements also verify Files and Artifacts, workspace identity, that no credentials appear in public responses and that foreign history is rejected. Synthetic or failed runs never count. The opt-in tests below run the pinned-SDK fixtures in `services/core/tests` against a real daemon and model; each runs when `OAC_TEST_OFFICIAL_SDK_PYTHON`, `OAC_TEST_NATIVE_DAEMON_BIN`, `OAC_TEST_NATIVE_PROOF_DIR` and its private options file are set. The options file is a JSON object with exactly `model` and `model_provider` (the fields of `x_agents_core.model_provider`); the test sets it as the deployment default model provider, which the fixtures' `environment: none` Sessions freeze at creation.
4. **Regression.** Existing Harnesses keep working. Run targeted tests, then `make check`; run `make openapi` after API changes and `make sqlc-generate` after query changes.
5. **Review.** Follow the [blind review workflow](https://github.com/MiniMax-AI/OpenAgentCore/blob/main/CONTRIBUTING.md#review).

Expand All @@ -250,7 +250,7 @@ Before starting, record the operation set, expected results, exclusions and stop
| Deferred function discovery | `TestNativeToolSearchPublicExecution` | `OAC_TEST_TOOL_SEARCH_REAL_OPTIONS` |
| Disabled web search and programmatic tool calling | `TestNativeToolPolicyPublicExecution` | `OAC_TEST_TOOL_POLICY_REAL_OPTIONS`, `OAC_TEST_TOOL_POLICY_ENGINE` |

Environment acceptance uses `services/core/tests/official_environment_{templates,setup,skills,plugins,plugin_mcp,composition,initial_files,network,skill_references}.py`. For composed preparation, change the Skill default and Template, delete the sources, retry and restart; verify frozen bytes, one setup execution and MCP cancellation. `official_hosted_structured_native.py` covers hosted structured output. Record exact source revisions, native versions and commands with each acceptance result.
Record exact source revisions, native versions and commands with each acceptance result.

Keep provider keys in private operator files, never in commits or logs. Existing focused tests, relative to `apps/daemon/internal/agent`:

Expand Down
2 changes: 1 addition & 1 deletion contracts/agents-api/model-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Session creation decrypts the default of the resolved Harness and freezes it in
The Harness and default-model reads include nullable `last_used_at`, `last_error_code` and `last_error_at`; PUT resets all three, even for the same bundle.

- Completed root Turns record use only when their Session froze the exact current default revision.
- Failed root Turns record only the native provider codes `authentication_error`, `connection_failed`, `rate_limit_exceeded`, `usage_limit_exceeded`, `server_overloaded`, `server_error`, `resource_not_found` and `invalid_request`. Input-policy, Core or Runtime, cancelled and waiting outcomes do not count.
- Failed root Turns record only the native provider codes `authentication_error`, `connection_failed`, `rate_limit_exceeded`, `usage_limit_exceeded`, `server_overloaded`, `server_error`, `resource_not_found`, `request_timeout` and `invalid_request`. Input-policy, Core or Runtime, cancelled and waiting outcomes do not count.
- A success keeps the earlier error; comparing the timestamps is a display convention.
- Errors are throttled for 30 seconds regardless of code, and ordinary successes for 30 seconds; the first success after an error records recovery at once. For an unchanged revision this allows at most three effective writes in any 30-second window of database time.
- Each observation has a one-second budget, including pool and row-lock acquisition, and cannot change the committed Turn. A crash, failure or throttle can omit the latest observation.
Expand Down
2 changes: 1 addition & 1 deletion contracts/agents-api/session-diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The object is `core.session_diagnostics`, with `session_id`, the official Sessio

A hosted provisioning failure takes precedence over input activity, and input activity over the latest root Turn; the public Session response uses the same precedence. Private outcome text, native messages, provider bodies, command text, paths and credentials are never included. Unknown outcome codes become `internal_error`; no prefix matching or reason-text parsing is used.

Provisioning parameters come from the confirmed structured receipt, persisted in the failure transaction that settles the Environment and its input and records the events. `step` is `setup`, `python`, `npm`, `file`, `skill` or null. `index` is a nonnegative JSON-safe integer for setup only, otherwise null. `exit_code` is 1 to 255 for script steps, otherwise null. Details that were not recorded remain null. These private fields do not change the public failure reason or SSE.
Provisioning parameters come from the confirmed structured receipt, persisted in the failure transaction that settles the Environment and its input and records the events. `step` is `setup`, `python`, `npm`, `file`, `skill`, `harness` or null. `index` is a nonnegative JSON-safe integer for setup only, otherwise null. `exit_code` is 1 to 255 for script steps, otherwise null. Details that were not recorded remain null. These private fields do not change the public failure reason or SSE.

## Turn snapshot and Item receipt timing

Expand Down
3 changes: 2 additions & 1 deletion contracts/agents-api/zh/core-errors.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Core 管理错误"
source: contracts/agents-api/core-errors.md
source_hash: 1532078430d8e8a5570e652db60a99b282d57897ca6f3360cd0b1a94a948d02d
source_hash: fbdf667a44da9eb95dae54ca7fc54129d7f8d1b50e1d7e864f00a8ce1794860b
---

`/core/v1` 上的错误使用此封装结构。`message` 是安全的英文文本;`code` 和 `param` 可以为 null。客户端依据稳定的 `code` 和可选的 `param` 进行处理,对未知代码显示 `message`,绝不解析消息,也绝不自动重试被拒绝的写操作。
Expand Down Expand Up @@ -120,6 +120,7 @@ Web 的控制台服务器在 `/core` 路径上发生自身故障时使用此封
| `server_error` | 原生服务器故障分类 |
| `invalid_request` | 原生请求被拒绝 |
| `resource_not_found` | 未找到原生资源或模型 |
| `request_timeout` | 原生提供商超时分类 |
| `context_length_exceeded` | 原生上下文限制分类 |
| `cyber_policy` | 原生网络安全策略拒绝 |
| `connection_failed` | 原生连接故障;params 包含 `http_status`,其值为 100–599 范围内的整数或 null |
Expand Down
Loading
Loading