|
@@ -88,7 +88,7 @@ export class NotFoundError extends Schema.TaggedErrorClass<NotFoundError>()("Ses
|
|
|
export class OperationUnavailableError extends Schema.TaggedErrorClass<OperationUnavailableError>()(
|
|
export class OperationUnavailableError extends Schema.TaggedErrorClass<OperationUnavailableError>()(
|
|
|
"Session.OperationUnavailableError",
|
|
"Session.OperationUnavailableError",
|
|
|
{
|
|
{
|
|
|
- operation: Schema.Literals(["move", "shell", "skill", "switchAgent", "switchModel", "compact", "wait"]),
|
|
|
|
|
|
|
+ operation: Schema.Literals(["move", "shell", "skill", "switchAgent", "compact", "wait"]),
|
|
|
},
|
|
},
|
|
|
) {}
|
|
) {}
|
|
|
|
|
|
|
@@ -386,13 +386,7 @@ export const layer = Layer.effect(
|
|
|
return yield* new OperationUnavailableError({ operation: "switchAgent" })
|
|
return yield* new OperationUnavailableError({ operation: "switchAgent" })
|
|
|
}),
|
|
}),
|
|
|
switchModel: Effect.fn("V2Session.switchModel")(function* (input) {
|
|
switchModel: Effect.fn("V2Session.switchModel")(function* (input) {
|
|
|
- const session = yield* result.get(input.sessionID)
|
|
|
|
|
- if (
|
|
|
|
|
- session.model?.providerID === input.model.providerID &&
|
|
|
|
|
- session.model.id === input.model.id &&
|
|
|
|
|
- (session.model.variant ?? "default") === (input.model.variant ?? "default")
|
|
|
|
|
- )
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ yield* result.get(input.sessionID)
|
|
|
yield* events.publish(SessionEvent.ModelSwitched, {
|
|
yield* events.publish(SessionEvent.ModelSwitched, {
|
|
|
sessionID: input.sessionID,
|
|
sessionID: input.sessionID,
|
|
|
messageID: SessionMessage.ID.create(),
|
|
messageID: SessionMessage.ID.create(),
|