Skip to content

Commit f6bf9d1

Browse files
committed
fix: update pi harness runtime API
1 parent ed3bb27 commit f6bf9d1

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

  • src/lib/steps/harness

‎src/lib/steps/harness/pi.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ export const piHarness: Harness = {
8484
createAgentSession,
8585
DefaultResourceLoader,
8686
SessionManager,
87-
AuthStorage,
88-
ModelRegistry,
87+
ModelRuntime,
8988
getAgentDir,
9089
createReadToolDefinition,
9190
createEditToolDefinition,
@@ -98,8 +97,11 @@ export const piHarness: Harness = {
9897
// Register the Seam proxy as an anthropic-messages provider: same protocol
9998
// the claude-agent-sdk path uses, the scoped wizard token sent as the Bearer
10099
// the proxy authenticates. Provider cost is zero (metered server-side).
101-
const registry = ModelRegistry.inMemory(AuthStorage.inMemory())
102-
registry.registerProvider(PROVIDER, {
100+
const modelRuntime = await ModelRuntime.create({
101+
modelsPath: null,
102+
refreshOnCreate: false,
103+
})
104+
modelRuntime.registerProvider(PROVIDER, {
103105
name: 'Seam Inference',
104106
baseUrl: inference.base_url,
105107
apiKey: inference.token,
@@ -127,7 +129,7 @@ export const piHarness: Harness = {
127129
},
128130
],
129131
})
130-
const model = registry.find(PROVIDER, modelId)
132+
const model = modelRuntime.getModel(PROVIDER, modelId)
131133
if (model == null) {
132134
return {
133135
ok: false,
@@ -170,7 +172,7 @@ export const piHarness: Harness = {
170172

171173
const { session } = await createAgentSession({
172174
model,
173-
modelRegistry: registry,
175+
modelRuntime,
174176
// Adaptive-thinking effort, matching the anthropic control's medium effort.
175177
thinkingLevel: 'medium',
176178
cwd,

0 commit comments

Comments
 (0)