@ai-sdk/harness-opencode 1.0.95 → 1.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/bridge/index.mjs +17 -0
- package/dist/bridge/index.mjs.map +1 -1
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/bridge/index.ts +22 -0
- package/src/opencode-harness.ts +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ai-sdk/harness-opencode
|
|
2
2
|
|
|
3
|
+
## 1.0.96
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8961fde: feat(harness): allow changing `model` between turns via call options
|
|
8
|
+
- Updated dependencies [8961fde]
|
|
9
|
+
- Updated dependencies [eb59f2a]
|
|
10
|
+
- @ai-sdk/harness@1.0.94
|
|
11
|
+
- @ai-sdk/provider-utils@5.0.34
|
|
12
|
+
|
|
3
13
|
## 1.0.95
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/bridge/index.mjs
CHANGED
|
@@ -1713,6 +1713,7 @@ async function runTurn(start, turn) {
|
|
|
1713
1713
|
await client.instance.dispose({ directory: workdir });
|
|
1714
1714
|
}
|
|
1715
1715
|
const sessionId = await ensureSession({ client, start, emit });
|
|
1716
|
+
await switchSessionModel({ client, sessionId, start });
|
|
1716
1717
|
if (start.operation === "compact") {
|
|
1717
1718
|
await runCompaction({ client, sessionId, start, turn, emit });
|
|
1718
1719
|
} else {
|
|
@@ -1729,6 +1730,22 @@ async function runTurn(start, turn) {
|
|
|
1729
1730
|
});
|
|
1730
1731
|
}
|
|
1731
1732
|
}
|
|
1733
|
+
async function switchSessionModel({
|
|
1734
|
+
client,
|
|
1735
|
+
sessionId,
|
|
1736
|
+
start
|
|
1737
|
+
}) {
|
|
1738
|
+
const model = modelRefFromStart(start);
|
|
1739
|
+
if (model == null) return;
|
|
1740
|
+
const response = await client.v2.session.switchModel({
|
|
1741
|
+
sessionID: sessionId,
|
|
1742
|
+
model: {
|
|
1743
|
+
id: model.modelID,
|
|
1744
|
+
providerID: model.providerID
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
if (response.error != null) throw response.error;
|
|
1748
|
+
}
|
|
1732
1749
|
async function ensureRuntime({
|
|
1733
1750
|
start,
|
|
1734
1751
|
turn,
|