rrce-workflow 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -0
- package/docs/MIGRATION-v2.md +16 -11
- package/docs/opencode-guide-optimization-addendum.md +33 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1107,6 +1107,33 @@ import { stringify } from "yaml";
|
|
|
1107
1107
|
function getOpenCodeConfigPath() {
|
|
1108
1108
|
return path8.join(os2.homedir(), ".config", "opencode", "opencode.json");
|
|
1109
1109
|
}
|
|
1110
|
+
function enableProviderCaching() {
|
|
1111
|
+
const opencodePath = getOpenCodeConfigPath();
|
|
1112
|
+
let config = {};
|
|
1113
|
+
if (fs7.existsSync(opencodePath)) {
|
|
1114
|
+
try {
|
|
1115
|
+
config = JSON.parse(fs7.readFileSync(opencodePath, "utf8"));
|
|
1116
|
+
} catch (e) {
|
|
1117
|
+
console.error("Warning: Could not parse existing OpenCode config, creating new provider section");
|
|
1118
|
+
}
|
|
1119
|
+
} else {
|
|
1120
|
+
ensureDir(path8.dirname(opencodePath));
|
|
1121
|
+
}
|
|
1122
|
+
if (!config.provider) {
|
|
1123
|
+
config.provider = {};
|
|
1124
|
+
}
|
|
1125
|
+
const providers = ["anthropic", "openai", "openrouter", "google"];
|
|
1126
|
+
for (const provider of providers) {
|
|
1127
|
+
if (!config.provider[provider]) {
|
|
1128
|
+
config.provider[provider] = {};
|
|
1129
|
+
}
|
|
1130
|
+
if (!config.provider[provider].options) {
|
|
1131
|
+
config.provider[provider].options = {};
|
|
1132
|
+
}
|
|
1133
|
+
config.provider[provider].options.setCacheKey = true;
|
|
1134
|
+
}
|
|
1135
|
+
fs7.writeFileSync(opencodePath, JSON.stringify(config, null, 2));
|
|
1136
|
+
}
|
|
1110
1137
|
function copyPromptsToDir(prompts, targetDir, extension) {
|
|
1111
1138
|
for (const prompt of prompts) {
|
|
1112
1139
|
const baseName = path8.basename(prompt.filePath, ".md");
|
|
@@ -6169,6 +6196,7 @@ async function installAgentPrompts(config, workspacePath, dataPaths) {
|
|
|
6169
6196
|
const primaryDataPath = dataPaths[0];
|
|
6170
6197
|
if (primaryDataPath) {
|
|
6171
6198
|
surgicalUpdateOpenCodeAgents(prompts, config.storageMode, primaryDataPath);
|
|
6199
|
+
enableProviderCaching();
|
|
6172
6200
|
}
|
|
6173
6201
|
}
|
|
6174
6202
|
}
|
package/docs/MIGRATION-v2.md
CHANGED
|
@@ -94,31 +94,36 @@ Orchestrator: (Detects user wants implementation, auto-proceeds to planning →
|
|
|
94
94
|
|
|
95
95
|
---
|
|
96
96
|
|
|
97
|
-
### 4.
|
|
97
|
+
### 4. Provider Caching Configuration (Model-Agnostic)
|
|
98
98
|
|
|
99
|
-
**What changed:**
|
|
99
|
+
**What changed:** RRCE now enables provider caching for ALL providers, but does NOT force specific models
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
| Executor | Sonnet 4 | Sonnet 4 | No change |
|
|
101
|
+
**New behavior:**
|
|
102
|
+
- `setCacheKey: true` enabled for Anthropic, OpenAI, OpenRouter, Google
|
|
103
|
+
- **No hardcoded models** - you choose what model to use
|
|
104
|
+
- Prompt caching activates automatically for any model that supports it
|
|
106
105
|
|
|
107
|
-
**
|
|
106
|
+
**Recommended models** (optional, for cost optimization):
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
| Agent | Recommendation | Rationale |
|
|
109
|
+
|-------|----------------|-----------|
|
|
110
|
+
| Research | Haiku/Mini | Q&A doesn't need heavy reasoning |
|
|
111
|
+
| Planning | Sonnet/GPT-4o | Task breakdown needs reasoning |
|
|
112
|
+
| Executor | Sonnet/GPT-4o | Code generation needs power |
|
|
110
113
|
|
|
111
|
-
**To
|
|
114
|
+
**To set models per agent (optional):**
|
|
112
115
|
```json
|
|
113
116
|
{
|
|
114
117
|
"agent": {
|
|
115
118
|
"rrce_research_discussion": {
|
|
116
|
-
"model": "anthropic/claude-
|
|
119
|
+
"model": "anthropic/claude-haiku-4-20250514"
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
```
|
|
121
124
|
|
|
125
|
+
**Migration action:** None required - caching is automatic
|
|
126
|
+
|
|
122
127
|
---
|
|
123
128
|
|
|
124
129
|
### 5. Session State Management
|
|
@@ -138,22 +138,39 @@ Turn 3: Reference cached findings → Generate brief
|
|
|
138
138
|
|
|
139
139
|
---
|
|
140
140
|
|
|
141
|
-
## 💰 Model Configuration
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
|
148
|
-
|
|
149
|
-
| **
|
|
150
|
-
| **
|
|
151
|
-
|
|
152
|
-
**
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
141
|
+
## 💰 Model Configuration (User Choice)
|
|
142
|
+
|
|
143
|
+
**RRCE does NOT force specific models.** You choose what works for you!
|
|
144
|
+
|
|
145
|
+
The optimization works with **ANY model** you configure in OpenCode. What we enable:
|
|
146
|
+
|
|
147
|
+
| Feature | What It Does | Works With |
|
|
148
|
+
|---------|--------------|------------|
|
|
149
|
+
| **Provider Caching** | `setCacheKey: true` for all providers | Anthropic, OpenAI, OpenRouter, Google |
|
|
150
|
+
| **Prompt Caching** | Automatic via `promptCacheKey = sessionID` | Any model that supports caching |
|
|
151
|
+
| **Slim Prompts** | 70-93% smaller prompts | ALL models |
|
|
152
|
+
| **Session Reuse** | Orchestrator reuses sessions | ALL models |
|
|
153
|
+
|
|
154
|
+
### Recommended Models (Optional)
|
|
155
|
+
|
|
156
|
+
If you want cost optimization, consider:
|
|
157
|
+
|
|
158
|
+
| Agent | Recommendation | Rationale |
|
|
159
|
+
|-------|----------------|-----------|
|
|
160
|
+
| **Research** | Haiku/Mini | Q&A doesn't need heavy reasoning |
|
|
161
|
+
| **Planning** | Sonnet/GPT-4o | Task breakdown needs reasoning |
|
|
162
|
+
| **Executor** | Sonnet/GPT-4o | Code generation needs power |
|
|
163
|
+
|
|
164
|
+
**To set models per agent (optional):**
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"agent": {
|
|
168
|
+
"rrce_research_discussion": {
|
|
169
|
+
"model": "anthropic/claude-haiku-4-20250514"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
157
174
|
|
|
158
175
|
**Configuration location:** `opencode.json` in project root or `~/.config/opencode/opencode.json`
|
|
159
176
|
|