@springbrand/agent-runtime 0.3.0-alpha.15 → 0.3.0-alpha.16
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/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type DriveOptions,
|
|
10
10
|
type OpenOperation,
|
|
11
11
|
type OperationRequest,
|
|
12
|
+
type ThinkingLevel,
|
|
12
13
|
} from "@earendil-works/pi-agent-core";
|
|
13
14
|
import type { Context } from "@earendil-works/pi-agent-core/harness/context";
|
|
14
15
|
import type { Entry, SettledAssistantMessage } from "@earendil-works/pi-agent-core/harness/session";
|
|
@@ -203,6 +204,8 @@ function positiveInteger(value: number | undefined, fallback: number): number {
|
|
|
203
204
|
*/
|
|
204
205
|
export class SessionHarness<TContext extends object | undefined> {
|
|
205
206
|
private _openOperation: OpenOperation | null;
|
|
207
|
+
private readonly model: AgentHarnessOptions<TContext>["model"];
|
|
208
|
+
private readonly thinkingLevel: ThinkingLevel;
|
|
206
209
|
private readonly modelTurnsPerSlice: number;
|
|
207
210
|
private readonly maxModelTurns: number;
|
|
208
211
|
private readonly maxWrapUpModelTurns: number;
|
|
@@ -245,6 +248,8 @@ export class SessionHarness<TContext extends object | undefined> {
|
|
|
245
248
|
options: SessionHarnessOptions<TContext>,
|
|
246
249
|
) {
|
|
247
250
|
this._openOperation = openOperation;
|
|
251
|
+
this.model = options.model;
|
|
252
|
+
this.thinkingLevel = options.thinkingLevel ?? "off";
|
|
248
253
|
this.modelTurnsPerSlice = positiveInteger(
|
|
249
254
|
options.limits?.modelTurnsPerSlice,
|
|
250
255
|
DEFAULT_MODEL_TURNS_PER_SLICE,
|
|
@@ -568,6 +573,12 @@ export class SessionHarness<TContext extends object | undefined> {
|
|
|
568
573
|
this.toolFailureWrapUp = false;
|
|
569
574
|
this.toolFailureWrapUpAt = undefined;
|
|
570
575
|
this.releaseReason = undefined;
|
|
576
|
+
// Pi restores persisted lane settings; current settings apply only to new operations.
|
|
577
|
+
await this.lane.setModel({
|
|
578
|
+
provider: this.model.provider,
|
|
579
|
+
modelId: this.model.id,
|
|
580
|
+
}, context);
|
|
581
|
+
await this.lane.setThinkingLevel(this.thinkingLevel, context);
|
|
571
582
|
await this.lane.setActiveTools(
|
|
572
583
|
await this.activeToolsForNewOperation(context),
|
|
573
584
|
context,
|