.
This commit is contained in:
1 parent
7fa293c9e8
commit
ae44aa03db
67 files changed
+6164
-243
No files matched your search
+8
-1
@@ -6,7 +6,11 @@ import { getLogger } from "@obs/logger";
|
||||
import { withSkillSpan, withSpan } from "@obs/spans";
|
||||
import type { Skill } from "@skills/skill";
|
||||
import type { AgentRequest, AgentResponse } from "./types.js";
|
||||
import { getRequestSubject } from "../config.js";
|
||||
import {
|
||||
getAgentRequestTimeoutMs,
|
||||
getRequestSubject,
|
||||
getSafetyMarginMs,
|
||||
} from "../config.js";
|
||||
|
||||
function isValidRequest(data: unknown): data is AgentRequest {
|
||||
if (typeof data !== "object" || data === null) return false;
|
||||
@@ -64,6 +68,9 @@ export class Agent {
|
||||
await runWithContext(
|
||||
{
|
||||
chatroomId: request.chatroomId,
|
||||
deadlineAt: new Date(
|
||||
Date.now() + getAgentRequestTimeoutMs() - getSafetyMarginMs(),
|
||||
).toISOString(),
|
||||
requestId: request.requestId,
|
||||
skill: request.skill,
|
||||
startedAt: new Date().toISOString(),
|
||||
|
||||
Reference in new issue
Block a user