Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/agents/definitions/implementation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ backend:
scm:
enableStopHooks: true
requiresPR: true
postConfigure: sequentialGadgetExecution


hint: >-
Expand Down
1 change: 0 additions & 1 deletion src/agents/definitions/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ const BackendSchema = z.object({
requiresPR: z.boolean().optional(),
/** Category-scoped hook configuration */
hooks: HooksSchema.optional(),
postConfigure: z.enum(['sequentialGadgetExecution']).optional(),
});

const TrailingMessageSchema = z
Expand Down
7 changes: 1 addition & 6 deletions src/agents/shared/builderFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export interface CreateBuilderOptions {
skipSessionState?: boolean;
/** Remaining card budget in USD — passed to llmist's withBudget() for in-flight enforcement */
remainingBudgetUsd?: number;
/** Post-configuration callback for agent-specific builder tweaks */
postConfigure?: (builder: BuilderType) => BuilderType;
/** Accumulator for per-call LLM metrics (for run tracking) */
llmCallAccumulator?: AccumulatedLlmCall[];
/** Run ID for real-time LLM call logging (resolved before builder creation) */
Expand Down Expand Up @@ -73,7 +71,6 @@ export async function createConfiguredBuilder(options: CreateBuilderOptions): Pr
progressMonitor,
skipSessionState,
remainingBudgetUsd,
postConfigure,
} = options;

// Initialize session state for gadgets (e.g., Finish checks PR requirement for implementation)
Expand Down Expand Up @@ -128,9 +125,7 @@ export async function createConfiguredBuilder(options: CreateBuilderOptions): Pr
}
}

if (postConfigure) {
builder = postConfigure(builder);
}
builder = builder.withGadgetExecutionMode('sequential');

return builder;
}
16 changes: 0 additions & 16 deletions src/backends/llmist/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import os from 'node:os';
import { LLMist, type ModelSpec, createLogger } from 'llmist';

import { createIntegrationChecker } from '../../agents/capabilities/index.js';
import { resolveAgentDefinition } from '../../agents/definitions/index.js';
import { type BuilderType, createConfiguredBuilder } from '../../agents/shared/builderFactory.js';
import { injectSyntheticCall } from '../../agents/shared/syntheticCalls.js';
import { runAgentLoop } from '../../agents/utils/agentLoop.js';
Expand All @@ -17,11 +16,6 @@ import { extractPRUrl } from '../../utils/prUrl.js';
import { getAgentProfile } from '../agent-profiles.js';
import type { AgentBackend, AgentBackendInput, AgentBackendResult } from '../types.js';

/** Post-configure registry: maps YAML string references to builder transform functions */
const POST_CONFIGURE_REGISTRY: Record<string, (builder: BuilderType) => BuilderType> = {
sequentialGadgetExecution: (b) => b.withGadgetExecutionMode('sequential'),
};

/**
* llmist backend — executes agents using the llmist SDK.
*
Expand Down Expand Up @@ -122,16 +116,6 @@ export class LlmistBackend implements AgentBackend {
progressMonitor: progressReporter as Parameters<
typeof createConfiguredBuilder
>[0]['progressMonitor'],
// Post-configure hook from YAML definition (e.g., sequentialGadgetExecution for implementation)
postConfigure: await (async () => {
try {
const def = await resolveAgentDefinition(agentType);
const hookName = def.backend.postConfigure;
return hookName ? POST_CONFIGURE_REGISTRY[hookName] : undefined;
} catch {
return undefined;
}
})(),
});

// Convert ContextInjection[] from the unified adapter into synthetic gadget calls.
Expand Down
6 changes: 0 additions & 6 deletions tests/unit/agents/definitions/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ describe('YAML agent definitions loader', () => {
});

describe('definition content spot checks', () => {
it('implementation has postConfigure hook', () => {
const def = loadAgentDefinition('implementation');
expect(def.backend.postConfigure).toBe('sequentialGadgetExecution');
});

it('implementation has requiresPR flag in hooks.scm', () => {
const def = loadAgentDefinition('implementation');
expect(def.backend.hooks?.scm?.requiresPR).toBe(true);
Expand Down Expand Up @@ -265,7 +260,6 @@ describe('YAML agent definitions loader', () => {
expect(caps.isReadOnly).toBe(false);
expect(def.backend.hooks?.scm?.enableStopHooks).toBe(true);
expect(def.backend.needsGitHubToken).toBe(true);
expect(def.backend.postConfigure).toBe('sequentialGadgetExecution');
});

it('review agent is read-only', async () => {
Expand Down
19 changes: 0 additions & 19 deletions tests/unit/agents/definitions/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ describe('AgentDefinitionSchema', () => {
backend: {
...validDefinition.backend,
blockGitPush: false,
postConfigure: 'sequentialGadgetExecution',
},
trailingMessage: {
includeDiagnostics: true,
Expand Down Expand Up @@ -388,24 +387,6 @@ describe('AgentDefinitionSchema', () => {
}
});

it('rejects invalid postConfigure hook names', () => {
const bad = {
...validDefinition,
backend: { ...validDefinition.backend, postConfigure: 'nonexistentHook' },
};
const result = AgentDefinitionSchema.safeParse(bad);
expect(result.success).toBe(false);
});

it('accepts valid postConfigure hook name', () => {
const good = {
...validDefinition,
backend: { ...validDefinition.backend, postConfigure: 'sequentialGadgetExecution' },
};
const result = AgentDefinitionSchema.safeParse(good);
expect(result.success).toBe(true);
});

it('accepts requiresPR boolean', () => {
const good = {
...validDefinition,
Expand Down
21 changes: 5 additions & 16 deletions tests/unit/agents/shared/builderFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const mockBuilderInstance = {
withGadgets: vi.fn(),
withMaxGadgetsPerResponse: vi.fn(),
withBudget: vi.fn(),
withGadgetExecutionMode: vi.fn(),
};

// Each method returns the builder for chaining
Expand Down Expand Up @@ -232,22 +233,10 @@ describe('createConfiguredBuilder', () => {
await expect(createConfiguredBuilder(options)).rejects.toThrow('Unexpected budget error');
});

it('calls postConfigure callback when provided', async () => {
const customBuilder = { ...mockBuilderInstance, custom: true };
const postConfigure = vi.fn().mockReturnValue(customBuilder);
const options = createBaseOptions({ postConfigure });

const result = await createConfiguredBuilder(options);

expect(postConfigure).toHaveBeenCalled();
expect(result).toBe(customBuilder);
});

it('does not call postConfigure when not provided', async () => {
const options = createBaseOptions({ postConfigure: undefined });

// Should not throw and returns builder
await expect(createConfiguredBuilder(options)).resolves.not.toThrow();
it('calls withGadgetExecutionMode with sequential unconditionally', async () => {
const options = createBaseOptions();
await createConfiguredBuilder(options);
expect(mockBuilderInstance.withGadgetExecutionMode).toHaveBeenCalledWith('sequential');
});

it('returns a builder with max gadgets per response set', async () => {
Expand Down
28 changes: 0 additions & 28 deletions web/src/components/settings/agent-definition-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ import {
import { Badge } from '@/components/ui/badge.js';
import { Input } from '@/components/ui/input.js';
import { Label } from '@/components/ui/label.js';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/components/ui/select.js';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs.js';
import { Textarea } from '@/components/ui/textarea.js';
import {
Expand Down Expand Up @@ -449,27 +442,6 @@ function BackendSection({
description="Agent receives GitHub token for API access. Required for PR creation and code reviews."
/>
</div>

<div className="grid grid-cols-1 gap-3">
<div className="space-y-1">
<div className="flex items-center gap-1.5">
<Label>Post-Configure Hook</Label>
<InfoTooltip text="Hook run after builder configuration. 'sequentialGadgetExecution' forces serial gadget execution." />
</div>
<Select
value={def.backend.postConfigure ?? '_none'}
onValueChange={(v) => setBackend('postConfigure', v === '_none' ? undefined : v)}
>
<SelectTrigger className="w-full">
<SelectValue placeholder="None" />
</SelectTrigger>
<SelectContent>
<SelectItem value="_none">None</SelectItem>
<SelectItem value="sequentialGadgetExecution">sequentialGadgetExecution</SelectItem>
</SelectContent>
</Select>
</div>
</div>
</section>
);
}
Expand Down