fix: recover Workbench terminal outbox projection
This commit is contained in:
@@ -1425,7 +1425,7 @@ function agentRunProjectionResumeCandidateFromState(state = {}, { minAgeMs = DEF
|
||||
}
|
||||
|
||||
async function resumeAgentRunProjectionCandidate({ candidate, options = {}, traceStore = defaultCodeAgentTraceStore } = {}) {
|
||||
const currentResult = await agentRunProjectionResumeResultWithCursor(candidate, options);
|
||||
const { currentResult } = await agentRunProjectionResumeResultWithCursor(candidate, options);
|
||||
const resumeOptions = { ...options, deferAgentRunResultSync: false };
|
||||
const synced = await syncAgentRunChatResult({
|
||||
traceId: candidate.traceId,
|
||||
@@ -1450,12 +1450,15 @@ async function agentRunProjectionResumeResultWithCursor(candidate, options = {})
|
||||
pageLimit: options.env?.HWLAB_CODE_AGENT_AGENTRUN_EVENTS_PAGE_LIMIT
|
||||
});
|
||||
return {
|
||||
...candidate.result,
|
||||
traceSummary: null,
|
||||
agentRun: {
|
||||
...candidate.result.agentRun,
|
||||
lastSeq: plan.afterSeq,
|
||||
valuesPrinted: false
|
||||
projectionState,
|
||||
currentResult: {
|
||||
...candidate.result,
|
||||
traceSummary: null,
|
||||
agentRun: {
|
||||
...candidate.result.agentRun,
|
||||
lastSeq: plan.afterSeq,
|
||||
valuesPrinted: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -2283,7 +2286,11 @@ export async function handleCodeAgentCancelHttp(request, response, options) {
|
||||
}
|
||||
const payload = await cancelAgentRunChatTurn({ traceId, currentResult, options, traceStore });
|
||||
if (payload) {
|
||||
await recordCodeAgentSessionOwner({ payload, params: { ...params, traceId, ownerUserId: options.actor?.id, ownerRole: options.actor?.role }, options, status: "canceled" });
|
||||
if (payload.alreadyTerminal === true || isTraceCommandTerminalStatus(payload.status)) {
|
||||
await recordCodeAgentTerminalTurnStatusEffects({ payload, params: { ...params, traceId, ownerUserId: options.actor?.id, ownerRole: options.actor?.role }, options, preserveLastTraceId: true });
|
||||
} else {
|
||||
await recordCodeAgentSessionOwner({ payload, params: { ...params, traceId, ownerUserId: options.actor?.id, ownerRole: options.actor?.role }, options, status: "canceled" });
|
||||
}
|
||||
sendJson(response, 200, payload);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user