Commit bcfacb1
Add Azure feature parity: allowedTools, canUseTool, interrupt, audio, predicted output (#4)
* Add Azure feature parity: predicted output, audio, allowedTools, canUseTool, interrupt, session tool management
New ModelSettings fields:
- prediction: predicted output for faster completions (Chat Completions)
- modalities/audio: audio output for gpt-4o-audio models (Chat Completions)
- dataSources: Azure On Your Data RAG sources (Chat Completions)
- contextManagement: server-side context compaction (Responses API)
New RunOptions:
- allowedTools: glob-style wildcard filtering (e.g. "mcp__github__*")
- canUseTool: centralized HITL permission callback (allow/deny/modify)
New StreamedRunResult:
- interrupt(): graceful stop returning partial result instead of throwing
New Session methods:
- addTools/removeTools/setTools: hot-swap tools between turns
- allowedTools/canUseTool passthrough from SessionConfig
Bug fix: canUseTool deny now short-circuits needsApproval to prevent
unnecessary interrupts when the permission callback would deny anyway.
614 unit tests + 9 integration tests + 21 battle tests, all passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Bump @usestratus/sdk to v1.2.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix canUseTool double-invocation for dynamic needsApproval tools
Evaluate needsApproval before canUseTool in collectPendingApprovals.
Previously, tools with a needsApproval function that returned false
would still trigger canUseTool in the approval check, then again
during execution — causing double side effects (audit logs, rate
limit decrements, latency).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0fe6a2f commit bcfacb1
14 files changed
Lines changed: 1997 additions & 25 deletions
File tree
- packages/stratus-sdk
- src
- azure
- core
- codemode
- tests
- azure
- core
- integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
389 | 390 | | |
390 | 391 | | |
391 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 78 | + | |
83 | 79 | | |
84 | 80 | | |
85 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | | - | |
302 | | - | |
| 300 | + | |
303 | 301 | | |
304 | 302 | | |
305 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
126 | 138 | | |
127 | 139 | | |
128 | 140 | | |
| |||
0 commit comments