You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 83c638e
Browse filesBrowse the repository at this point in the historyBrowse files
|`timeoutMs`|none — no timeout | Wall-clock execution time.|
232
+
|`maxToolCalls`|none — unlimited | Tool calls admitted during the execution.|
229
233
|`maxOutputBytes`| none — no truncation | Model-facing output: the serialized result value plus captured logs. |
230
234
231
235
No limit has a default, on purpose: execution budgets are host policy, not library policy — a host that wants a bound sets one; a host that can interrupt the execution fiber (as OpenCode does on user cancel) may set no timeout, and a host with its own tool-output truncation (as OpenCode has) may leave `maxOutputBytes` unset. A host with neither should set `maxOutputBytes`, or oversized results silently flood model context.
@@ -254,28 +258,25 @@ Two interpreter internals are fixed constants rather than knobs: at most 8 tool
254
258
255
259
Failures are data:
256
260
257
-
| Kind | Meaning |
258
-
| --- | --- |
259
-
|`ParseError`| Source is empty or cannot be parsed. |
260
-
|`UnsupportedSyntax`| Parsed JavaScript is outside the supported subset. |
261
-
|`UnknownTool`| A program referenced a tool the host did not provide. |
262
-
|`InvalidToolInput`| Tool input failed schema decoding or safe-data copying. |
263
-
|`InvalidToolOutput`| Tool output failed schema decoding or safe-data copying. |
264
-
|`InvalidDataValue`| Program data violated the plain-data contract (depth, circularity, blocked properties, non-data values). |
|`ExecutionFailure`| The program threw or another execution error occurred.|
269
273
270
274
Unknown host failures, defects, invalid outputs, and copying failures are sanitized. To return a safe operational refusal, fail with `toolError`:
271
275
272
276
```ts
273
277
import { toolError } from"@opencode-ai/codemode"
274
278
275
-
run: ({ id }) =>
276
-
authorized(id)
277
-
?loadOrder(id)
278
-
:Effect.fail(toolError("Order is unavailable"))
279
+
run: ({ id }) => (authorized(id) ?loadOrder(id) :Effect.fail(toolError("Order is unavailable")))
279
280
```
280
281
281
282
Only the supplied message is model-visible. The optional cause is never returned in `ExecuteResult`; hosts should perform any required internal logging before crossing this boundary.
0 commit comments