feat: expose executor job observability
This commit is contained in:
@@ -44,6 +44,18 @@ test('LangGraph runtime checkpoints a deterministic observe-only code workflow',
|
||||
reason: 'executor_dispatch_not_implemented',
|
||||
durable: false,
|
||||
});
|
||||
assert.equal(
|
||||
(await runtime.getExecutorJob('run-shadow-1:executor-preview')).status,
|
||||
'blocked',
|
||||
);
|
||||
const executorEvents = await runtime.listExecutorJobEvents(
|
||||
'run-shadow-1:executor-preview',
|
||||
);
|
||||
assert.deepEqual(
|
||||
executorEvents.events.map((event) => event.type),
|
||||
['executor_job_blocked'],
|
||||
);
|
||||
assert.equal(executorEvents.nextCursor, 1);
|
||||
|
||||
const restored = await runtime.getState('run-shadow-1');
|
||||
assert.deepEqual(restored, state);
|
||||
@@ -128,3 +140,16 @@ test('LangGraph runtime rejects execution-enabled and unsupported workflows', as
|
||||
(error) => error.code === 'WORKFLOW_NOT_SUPPORTED' && error.status === 422,
|
||||
);
|
||||
});
|
||||
|
||||
test('LangGraph runtime derives a bounded opaque Executor Job id for long run ids', async () => {
|
||||
const runtime = createLangGraphOrchestratorRuntime({
|
||||
checkpointer: new MemorySaver(),
|
||||
});
|
||||
const state = await runtime.start(runSpec({
|
||||
runId: 'r'.repeat(128),
|
||||
requestId: 'request-long-run-id',
|
||||
}));
|
||||
assert.match(state.plan.executorJob.id, /^run_[a-f0-9]{64}:executor-preview$/);
|
||||
assert.ok(state.plan.executorJob.id.length <= 128);
|
||||
assert.equal((await runtime.getExecutorJob(state.plan.executorJob.id)).status, 'blocked');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user