@yachiyo-5i/xlyra-agent 1.3.0 → 1.3.1

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.
@@ -4296,6 +4296,12 @@ function createAgentRoutes(ctx) {
4296
4296
  if (!esc || esc.type !== "escalation") fail(404, "\u63D0\u6743\u8BF7\u6C42\u4E0D\u5B58\u5728\u6216\u5DF2\u8FC7\u671F");
4297
4297
  if (esc.resolved_path !== resolved_path) fail(400, "\u6388\u6743\u8DEF\u5F84\u4E0E\u63D0\u6743\u8BF7\u6C42\u4E0D\u4E00\u81F4");
4298
4298
  if (esc.granted !== null && esc.granted !== void 0) fail(400, "\u8BE5\u63D0\u6743\u8BF7\u6C42\u5DF2\u5904\u7406\u8FC7");
4299
+ const lastModelEntry = [...entries].reverse().find(
4300
+ (entry) => isMessageEntry(entry) && Boolean(entry.model?.trim())
4301
+ );
4302
+ const model = lastModelEntry && isMessageEntry(lastModelEntry) ? lastModelEntry.model?.trim() ?? "" : "";
4303
+ if (!model) fail(400, "\u65E0\u6CD5\u786E\u5B9A\u4F1A\u8BDD\u4F7F\u7528\u7684\u6A21\u578B\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u6D88\u606F");
4304
+ ctx.resolver.resolve(model);
4299
4305
  ctx.store.resolveEscalation(sessionId, escalation_id, granted);
4300
4306
  if (!granted) {
4301
4307
  const history2 = ctx.store.buildHistoryBeforeEscalation(sessionId, escalation_id);
@@ -4333,7 +4339,7 @@ function createAgentRoutes(ctx) {
4333
4339
  const { runId: runId2 } = await launchUserMessage({
4334
4340
  sessionId,
4335
4341
  content: "",
4336
- model: "",
4342
+ model,
4337
4343
  history: history2,
4338
4344
  entryCount: entries.length,
4339
4345
  recordUser: false
@@ -4349,12 +4355,11 @@ function createAgentRoutes(ctx) {
4349
4355
  (e) => isMessageEntry(e) && e.message.role === "user"
4350
4356
  );
4351
4357
  if (!lastUser || !isMessageEntry(lastUser)) fail(400, "\u4F1A\u8BDD\u4E2D\u6CA1\u6709\u53EF\u7EED\u8DD1\u7684\u7528\u6237\u6D88\u606F");
4352
- ctx.resolver.resolve("");
4353
4358
  const history = ctx.store.buildHistoryBeforeEscalation(sessionId, escalation_id);
4354
4359
  const { messageId, runId } = await launchUserMessage({
4355
4360
  sessionId,
4356
4361
  content: "",
4357
- model: "",
4362
+ model,
4358
4363
  history,
4359
4364
  entryCount: entries.length,
4360
4365
  recordUser: false
@@ -4971,4 +4976,4 @@ export {
4971
4976
  createAgentServer,
4972
4977
  serveFromConfig
4973
4978
  };
4974
- //# sourceMappingURL=chunk-5AIZKDJO.js.map
4979
+ //# sourceMappingURL=chunk-BOTYL4W5.js.map