@wjarka/cezarion 0.14.9-dev.1017 → 0.14.9-dev.1023

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3163,11 +3163,14 @@ export function createApp(deps) {
3163
3163
  const run = store.getRun(c.req.valid('param').id);
3164
3164
  if (!run)
3165
3165
  return c.json({ error: 'not found' }, 404);
3166
- // Full project store: archived/off-page workers still belong to this parent.
3166
+ // Off the parent's receipts, not a scan of the project index (#659): archived/off-page
3167
+ // workers still belong to this parent, and the cockpit asks on every run event, so the
3168
+ // read has to cost O(workers) whatever the store holds — and nothing at all for the
3169
+ // ordinary run that owns none, delegation on or off.
3167
3170
  // Human reads use the bound project, never agent credentials or private evidence.
3168
- const workers = store.listRuns().flatMap(worker => {
3171
+ const workers = store.listOwnedWorkers(run.id).flatMap(worker => {
3169
3172
  const owned = worker.delegation;
3170
- if (owned?.role !== 'worker' || owned.parentRunId !== run.id)
3173
+ if (owned?.role !== 'worker')
3171
3174
  return [];
3172
3175
  return [{ workerId: worker.id, parentRunId: run.id, status: worker.status, workspace: owned.workspace,
3173
3176
  ...(worker.currentStepId === undefined ? {} : { currentStepId: worker.currentStepId }),