Skip to content

Commit bd393b7

Browse files
gewenyu99claude
andcommitted
refactor(orchestrator): running status, queue cap, loader to lib/agent
Review follow-ups on the queue and loader: - TaskStatus 'in_progress' -> 'running' (drop the snake_case outlier) - inline the nowIso() one-liner - document that dependsOn is a DAG by construction (ids point only at earlier tasks), so cycles cannot form - cap the queue at 30 tasks as a runaway backstop; real sizing rests on agent/skill design - move agent-prompt-loader from programs/orchestrator/ to lib/agent/ Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 362c51f commit bd393b7

7 files changed

Lines changed: 44 additions & 605 deletions

File tree

src/lib/programs/orchestrator/__tests__/agent-prompt-loader.test.ts

Lines changed: 0 additions & 259 deletions
This file was deleted.

src/lib/programs/orchestrator/__tests__/queue-tools.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@ describe('checkEnqueueGuards', () => {
5757
const r = checkEnqueueGuards(ctx, { type: 'init', reason: 'x' });
5858
expect(r).toEqual({ ok: true });
5959
});
60+
61+
it('refuses to grow the queue past the runaway cap', () => {
62+
for (let i = 0; i < 30; i++) {
63+
store.enqueue({ type: 'capture', inputs: { i } });
64+
}
65+
const r = checkEnqueueGuards(ctx, {
66+
type: 'init',
67+
inputs: { i: 30 },
68+
reason: 'x',
69+
});
70+
expect(r).toMatchObject({ ok: false, guard: 'queue-full' });
71+
});
6072
});
6173

6274
describe('apply functions', () => {

0 commit comments

Comments
 (0)