Skip to content

GEPA optimizer broken and produces default prompt as instruction #463

@MrSpreadsheet

Description

@MrSpreadsheet

private async getBaseInstruction<IN, OUT extends AxGenOut>(
program: Readonly<AxGen<IN, OUT>>
): Promise<string> {
try {
// If program exposes instruction via signature, prefer it
const sig: any = program.getSignature?.();
if (
sig &&
typeof sig.instruction === 'string' &&
sig.instruction.length > 0
) {
return sig.instruction as string;
}
} catch {}
return 'Follow the task precisely. Be concise, correct, and consistent.';
}

This code is accessing sig.instruction, which isn't a property on AxSignature, and then defaults to 'Follow the task precisely. Be concise, correct, and consistent.'. My GEPA results always have the fallback string as the instruction. Troubleshooting this has cost me few bucks unfortunately.

I've only recently started using TypeScript, but I don't understand what's the point of using it if bugs like this are not caught. At the very least the error shouldn't just be swallowed like this in the catch statement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    julesGoogle Jules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions