Commit 0356c8e
committed
feat(sdk): add max_execution_time_ms to Node and Python SDKs
Align SDK interfaces with Rust Core by adding max_execution_time_ms
configuration field to both Node.js and Python SDKs.
Changes:
- Node SDK: Add max_execution_time_ms to SessionOptions
- Node SDK: Add conversion logic in js_session_options_to_rust
- Python SDK: Add max_execution_time_ms to PySessionOptions
- Python SDK: Add conversion logic in build_rust_session_options
- Python SDK: Update Clone impl and new() constructor
This ensures users can configure execution timeout from JavaScript
and Python, preventing runaway executions and excessive API costs.
Usage (Node.js):
```js
agent.session('.', {
maxExecutionTimeMs: 300000 // 5 minutes
});
```
Usage (Python):
```python
opts = SessionOptions()
opts.max_execution_time_ms = 300000 # 5 minutes
session = agent.session('.', opts)
```
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 436fd95 commit 0356c8e
2 files changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
1414 | 1425 | | |
1415 | 1426 | | |
1416 | 1427 | | |
| |||
1730 | 1741 | | |
1731 | 1742 | | |
1732 | 1743 | | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
1733 | 1749 | | |
1734 | 1750 | | |
1735 | 1751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3059 | 3059 | | |
3060 | 3060 | | |
3061 | 3061 | | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
3062 | 3065 | | |
3063 | 3066 | | |
3064 | 3067 | | |
| |||
3124 | 3127 | | |
3125 | 3128 | | |
3126 | 3129 | | |
| 3130 | + | |
3127 | 3131 | | |
3128 | 3132 | | |
3129 | 3133 | | |
| |||
3165 | 3169 | | |
3166 | 3170 | | |
3167 | 3171 | | |
| 3172 | + | |
3168 | 3173 | | |
3169 | 3174 | | |
3170 | 3175 | | |
| |||
3894 | 3899 | | |
3895 | 3900 | | |
3896 | 3901 | | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
3897 | 3905 | | |
3898 | 3906 | | |
3899 | 3907 | | |
| |||
0 commit comments