Commit 9859412
fix(opencode): add prompt caching to session compaction - Issue #10342
- Added SystemPrompt import to compaction.ts
- Changed system from empty array to include environment and custom prompts
- Enables ~90% cost savings on cached system prompts during compaction
- Aligns compaction behavior with normal request pattern
- Resolves performance and cost issue where system prompts were sent repeatedly without caching
Benefits:
- Reduced API costs (cached tokens cost ~90% less)
- Faster compaction responses
- Consistent behavior between normal requests and compaction
Technical details:
- System prompts now included in cache control strategy
- Matches pattern used in prompt.ts for normal requests
Related: Issue #103421 parent 31aadcf commit 9859412
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
0 commit comments