feat: expose executor job observability

This commit is contained in:
john
2026-07-24 23:31:29 +08:00
parent bbb43f97a3
commit 396bb78200
18 changed files with 733 additions and 68 deletions
+26 -1
View File
@@ -227,6 +227,18 @@ test('observability detail joins Native state with remote LangGraph checkpoint e
serviceToken: 'detail-token',
fetchImpl: async (url, init) => {
assert.equal(init.headers.authorization, 'Bearer detail-token');
if (String(url).includes('/executor-jobs/') && String(url).endsWith('/events')) {
return response({
events: [{ sequence: 1, type: 'executor_job_blocked' }],
});
}
if (String(url).includes('/executor-jobs/')) {
return response({
jobId: 'run-detail:executor-preview',
status: 'blocked',
reason: 'executor_dispatch_not_implemented',
});
}
if (String(url).endsWith('/events')) {
return response({
events: [{ sequence: 1, type: 'workflow_validated' }],
@@ -235,7 +247,10 @@ test('observability detail joins Native state with remote LangGraph checkpoint e
return response({
runId: 'run-detail',
status: 'succeeded',
plan: { executorAdapter: 'native-agent-run' },
plan: {
executorAdapter: 'native-agent-run',
executorJob: { id: 'run-detail:executor-preview' },
},
});
},
});
@@ -246,6 +261,9 @@ test('observability detail joins Native state with remote LangGraph checkpoint e
assert.equal(detail.remote.available, true);
assert.equal(detail.remote.state.plan.executorAdapter, 'native-agent-run');
assert.equal(detail.remote.events[0].type, 'workflow_validated');
assert.equal(detail.remote.executorJob.available, true);
assert.equal(detail.remote.executorJob.state.status, 'blocked');
assert.equal(detail.remote.executorJob.events[0].type, 'executor_job_blocked');
assert.equal(queries.length, 2);
});
@@ -327,6 +345,9 @@ test('canary readiness excludes smoke runs and reports explicit blockers', async
latencyMs: 5,
details: {
checkpoint: { kind: 'postgres', durable: true },
executorGateway: {
store: { kind: 'postgres', durable: true },
},
execution: 'observe-only',
},
},
@@ -384,6 +405,9 @@ test('canary readiness passes only when operational and sample gates all pass',
latencyMs: 4,
details: {
checkpoint: { kind: 'postgres', durable: true },
executorGateway: {
store: { kind: 'postgres', durable: true },
},
execution: 'observe-only',
},
},
@@ -402,6 +426,7 @@ test('canary readiness passes only when operational and sample gates all pass',
assert.equal(readiness.samples.latencyCoverageRate, 1);
assert.equal(readiness.samples.nativeSettledRate, 1);
assert.equal(readiness.samples.distinctSessions, 5);
assert.equal(readiness.service.executorJobStoreDurable, true);
assert.equal(readiness.blockers.length, 0);
assert.deepEqual(readiness.failureCodes, [{ code: 'TRANSIENT', count: 1 }]);
});