feat: shadow produce code agent kafka events
This commit is contained in:
@@ -21,6 +21,7 @@ import { scheduleWorkbenchProjectionFinalizer } from "./workbench-projection-fin
|
||||
import { writeWorkbenchProjectionSession, writeWorkbenchSessionAdmissionFact } from "./workbench-projection-writer.ts";
|
||||
import { buildAgentRunProjectionEventsFetchPlan } from "./workbench-projection-cursor.ts";
|
||||
import { createWorkbenchReadModel } from "./workbench-read-model.ts";
|
||||
import { publishHwlabAgentRunCommandShadow } from "./kafka-shadow-producer.ts";
|
||||
import { codeAgentOtelTraceFields, emitCodeAgentOtelSpan } from "./otel-trace.ts";
|
||||
import {
|
||||
firstHeaderValue,
|
||||
@@ -946,6 +947,13 @@ async function submitCodeAgentChatTurn({ params, options, traceId }) {
|
||||
});
|
||||
if (isCodeAgentResultCanceled(results.get(traceId))) return;
|
||||
const owned = annotateOwner(withCodeAgentBillingReservation(payload, dispatchParams), dispatchParams);
|
||||
publishHwlabAgentRunCommandShadow({
|
||||
params: dispatchParams,
|
||||
payload: owned,
|
||||
traceId,
|
||||
lifecycle: codeAgentTurnLifecycleFields(traceId, dispatchParams),
|
||||
env: executionOptions.env ?? process.env
|
||||
});
|
||||
await recordCodeAgentSessionOwner({ payload: owned, params: dispatchParams, options: executionOptions, status: "running" });
|
||||
results.set(traceId, owned);
|
||||
scheduleAgentRunProjectionSync({ traceId, params: dispatchParams, options: executionOptions, traceStore, currentResult: owned });
|
||||
|
||||
Reference in New Issue
Block a user