merge(read-exp): Reconcile 'afw/read-exp-v3' with 'main'

- Integrate model-specific tool optimizations (isGemini3) into read-file and snippets.
- Reconcile prompt snippets with main's Context Efficiency mandates and experiment's discovery guidelines.
- Adopt main's refactored tool definition structure while retaining experiment's surgical extraction guidance.
- Resolve pagination and truncation logic in file utilities.
- Update snapshots and verify with full test suite.
- Align prompt provider and snippets with main's code style and linting patterns.
This commit is contained in:
Adam Weidman
2026-02-26 09:50:36 -05:00
parent ef8a71bea4
commit 398baabc59
2 changed files with 12 additions and 4 deletions
+7 -3
View File
@@ -119,6 +119,7 @@ export class PromptProvider {
})),
coreMandates: this.withSection('coreMandates', () => ({
interactive: interactiveMode,
isGemini3: isModernModel,
hasSkills: skills.length > 0,
hasHierarchicalMemory,
contextFilenames,
@@ -175,7 +176,6 @@ export class PromptProvider {
'operationalGuidelines',
() => ({
interactive: interactiveMode,
isGemini3: isModernModel,
enableShellEfficiency: config.getEnableShellOutputEfficiency(),
interactiveShellEnabled: config.isInteractiveShellEnabled(),
}),
@@ -196,9 +196,13 @@ export class PromptProvider {
: this.withSection('finalReminder', () => ({
readFileToolName: READ_FILE_TOOL_NAME,
})),
};
} as snippets.SystemPromptOptions;
basePrompt = activeSnippets.getCoreSystemPrompt(options);
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
const getCoreSystemPrompt = activeSnippets.getCoreSystemPrompt as (
options: snippets.SystemPromptOptions,
) => string;
basePrompt = getCoreSystemPrompt(options);
}
// --- Finalization (Shell) ---
+5 -1
View File
@@ -35,6 +35,7 @@ export interface SystemPromptOptions {
sandbox?: SandboxMode;
interactiveYoloMode?: boolean;
gitRepo?: GitRepoOptions;
finalReminder?: FinalReminderOptions;
}
export interface PreambleOptions {
@@ -60,7 +61,6 @@ export interface PrimaryWorkflowsOptions {
export interface OperationalGuidelinesOptions {
interactive: boolean;
isGemini3: boolean;
enableShellEfficiency: boolean;
interactiveShellEnabled: boolean;
}
@@ -71,6 +71,10 @@ export interface GitRepoOptions {
interactive: boolean;
}
export interface FinalReminderOptions {
readFileToolName: string;
}
export interface PlanningWorkflowOptions {
planModeToolsList: string;
plansDir: string;