What do you want to change?
SUMMARIZATION_SYSTEM_PROMPT in packages/agent/src/harness/compaction/compaction.ts (L379) reads:
"...Your task is to read a conversation between a user and an AI coding assistant..."
There is no way to override it. Two options would fix this:
- Replace "AI coding assistant" with a neutral "an AI assistant"
- Accept an optional
summarizationSystemPrompt parameter in generateSummary that falls back to the built-in default
Why?
I'm building a general-purpose browser sidebar agent (cebian) on top of @earendil-works/pi and want to reuse the compaction mechanism. The current prompt produces suboptimal summaries for non-coding contexts, and there's no override path.
The agent package is core infrastructure. "AI coding assistant" is an application-layer concern that shouldn't be baked into the summarization path.
How? (optional)
I'd lean toward the simpler fix: replacing "AI coding assistant" with "an AI assistant" in the existing constant — a one-line change with no API surface impact.
That said, if an optional customSystemPrompt parameter is preferred for flexibility, I'm happy to go that route instead.
If this is acceptable, I can open a small PR after lgtm.
What do you want to change?
SUMMARIZATION_SYSTEM_PROMPTinpackages/agent/src/harness/compaction/compaction.ts(L379) reads:There is no way to override it. Two options would fix this:
summarizationSystemPromptparameter ingenerateSummarythat falls back to the built-in defaultWhy?
I'm building a general-purpose browser sidebar agent (cebian) on top of
@earendil-works/piand want to reuse the compaction mechanism. The current prompt produces suboptimal summaries for non-coding contexts, and there's no override path.The
agentpackage is core infrastructure. "AI coding assistant" is an application-layer concern that shouldn't be baked into the summarization path.How? (optional)
I'd lean toward the simpler fix: replacing "AI coding assistant" with "an AI assistant" in the existing constant — a one-line change with no API surface impact.
That said, if an optional
customSystemPromptparameter is preferred for flexibility, I'm happy to go that route instead.If this is acceptable, I can open a small PR after
lgtm.