chore: rebuild CentOS7 release package
This commit is contained in:
@@ -364,6 +364,62 @@ function completeTurn(thread, turnId, text, status = 'completed') {
|
||||
thread.steers = [];
|
||||
}
|
||||
|
||||
function completeGoalBackgroundTurn(thread, objective) {
|
||||
const turnId = `goal-turn-${crypto.randomUUID()}`;
|
||||
const text = `Goal background output: ${objective}`;
|
||||
thread.activeTurnId = turnId;
|
||||
send({
|
||||
method: 'turn/started',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turn: { id: turnId, status: 'running', items: [] },
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'item/agentMessage/delta',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turnId,
|
||||
itemId: 'goal-agent-msg',
|
||||
delta: text,
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'item/completed',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turnId,
|
||||
completedAtMs: Date.now(),
|
||||
item: {
|
||||
id: 'goal-agent-msg',
|
||||
type: 'agentMessage',
|
||||
text,
|
||||
status: 'completed',
|
||||
},
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'thread/tokenUsage/updated',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turnId,
|
||||
tokenUsage: tokenUsage(text),
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: 'turn/completed',
|
||||
params: {
|
||||
threadId: thread.id,
|
||||
turn: {
|
||||
id: turnId,
|
||||
status: 'completed',
|
||||
items: [],
|
||||
},
|
||||
},
|
||||
});
|
||||
thread.activeTurnId = null;
|
||||
}
|
||||
|
||||
function requestClient(method, params, callback) {
|
||||
const id = `mock-server-request-${nextServerRequestId++}`;
|
||||
pendingServerRequests.set(id, callback);
|
||||
@@ -874,6 +930,9 @@ function handleRequest(message) {
|
||||
});
|
||||
setTimeout(() => {
|
||||
send({ id, result: { goal: thread.goal } });
|
||||
if (params.objective) {
|
||||
setTimeout(() => completeGoalBackgroundTurn(thread, objective), 50);
|
||||
}
|
||||
}, 250);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user