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 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
  }
@@ -94,31 +94,36 @@ Orchestrator: (Detects user wants implementation, auto-proceeds to planning →
94
94
 
95
95
  ---
96
96
 
97
- ### 4. Model Configuration (Cost Optimization)
97
+ ### 4. Provider Caching Configuration (Model-Agnostic)
98
98
 
99
- **What changed:** Research agent now uses **Claude Haiku** by default (12x cheaper)
99
+ **What changed:** RRCE now enables provider caching for ALL providers, but does NOT force specific models
100
100
 
101
- | Agent | Old Model | New Model | Cost Change |
102
- |-------|-----------|-----------|-------------|
103
- | Research | Sonnet 4 | Haiku 4 | -92% |
104
- | Planning | Sonnet 4 | Sonnet 4 | No change |
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
- **Impact:** Research phase is now 98% cheaper, with minimal quality difference for Q&A tasks
106
+ **Recommended models** (optional, for cost optimization):
108
107
 
109
- **Migration action:** None required (configured in `opencode.json`)
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 revert to Sonnet for research:**
114
+ **To set models per agent (optional):**
112
115
  ```json
113
116
  {
114
117
  "agent": {
115
118
  "rrce_research_discussion": {
116
- "model": "anthropic/claude-sonnet-4-20250514"
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
- Optimized model selection for balanced cost/quality:
144
-
145
- | Agent | Model | Use Case | Cost |
146
- |-------|-------|----------|------|
147
- | **Research** | Claude Haiku 4 | Q&A, clarification | $0.25/M tokens |
148
- | **Planning** | Claude Sonnet 4 | Task breakdown, reasoning | $3/M tokens |
149
- | **Executor** | Claude Sonnet 4 | Code generation | $3/M tokens |
150
- | **Orchestrator** | Claude Sonnet 4 | Multi-phase coordination | $3/M tokens |
151
-
152
- **Why Haiku for Research?**
153
- - Research is primarily Q&A and documentation
154
- - Haiku is 12x cheaper than Sonnet
155
- - Quality is sufficient for clarification questions
156
- - Complex reasoning happens in Planning/Execution (Sonnet)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rrce-workflow",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "RRCE-Workflow TUI - Agentic code workflow generator for AI-assisted development",
5
5
  "author": "RRCE Team",
6
6
  "license": "MIT",