| 26 | const SUMMARY_INTERVAL_MS = 30_000 |
| 27 | |
| 28 | function buildSummaryPrompt(previousSummary: string | null): string { |
| 29 | const prevLine = previousSummary |
| 30 | ? `\nPrevious: "${previousSummary}" — say something NEW.\n` |
| 31 | : '' |
| 32 | |
| 33 | return `Describe your most recent action in 3-5 words using present tense (-ing). Name the file or function, not the branch. Do not use tools. |
| 34 | ${prevLine} |
| 35 | Good: "Reading runAgent.ts" |
| 36 | Good: "Fixing null check in validate.ts" |
| 37 | Good: "Running auth module tests" |
| 38 | Good: "Adding retry logic to fetchUser" |
| 39 | |
| 40 | Bad (past tense): "Analyzed the branch diff" |
| 41 | Bad (too vague): "Investigating the issue" |
| 42 | Bad (too long): "Reviewing full branch diff and AgentTool.tsx integration" |
| 43 | Bad (branch name): "Analyzed adam/background-summary branch diff"` |
| 44 | } |
| 45 | |
| 46 | export function startAgentSummarization( |
| 47 | taskId: string, |