vibeostheog 0.23.34 → 0.23.37

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.23.37
2
+ Fix plan mode agent restore
3
+
4
+
1
5
  ## 0.23.34
2
6
  - fix: restore footer ML-driven display + 6 integration tests calling _appendFooter directly to prevent regression from stale .ts compilation
3
7
  - fix: wire ensureProjectSkill into tool.execute.before and trinity guard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeostheog",
3
- "version": "0.23.34",
3
+ "version": "0.23.37",
4
4
  "description": "Cost-aware delegation enforcer for OpenCode. Tracks model usage, routes Task subagents to cheaper tiers, surfaces cumulative savings in chat. Includes research audit, reporting framework, project memory, progressive scratchpad decadence, and trinity CLI for brain/medium/cheap slot switching.",
5
5
  "scripts": {
6
6
  "release": "node scripts/release.mjs",
@@ -230,6 +230,9 @@ export function syncControlSettings(cv, options = {}) {
230
230
  if (existsSync(OC_CONFIG)) {
231
231
  const oc = safeJsonParse(readFileSync(OC_CONFIG, "utf-8"));
232
232
  if (oc.default_agent !== cv.agent_mode) {
233
+ if (cv.agent_mode === "plan" && oc.default_agent && oc.default_agent !== "plan") {
234
+ writeSelection("previous_default_agent", oc.default_agent);
235
+ }
233
236
  oc.default_agent = cv.agent_mode;
234
237
  writeFileSync(OC_CONFIG, JSON.stringify(oc, null, 2) + "\n");
235
238
  }
@@ -237,21 +240,20 @@ export function syncControlSettings(cv, options = {}) {
237
240
  }
238
241
  catch { }
239
242
  }
240
- if (cv.agent_mode === "plan" && latestUserIntent) {
241
- const planDone = /^(yes|go ahead|proceed|looks? good|do it|sounds? good|perfect|great|nice|ok|okay|let.s do it|implement|execute|make it|build it|write it|start)\b/i.test(latestUserIntent.trim());
242
- if (planDone) {
243
- try {
244
- const OC_CONFIG = TRINITY_OPENCODE_CONFIG || join(getOpenCodeHome(), "opencode.json");
245
- if (existsSync(OC_CONFIG)) {
246
- const oc = safeJsonParse(readFileSync(OC_CONFIG, "utf-8"));
247
- if (oc.default_agent === "plan") {
248
- oc.default_agent = "orchestrator";
249
- writeFileSync(OC_CONFIG, JSON.stringify(oc, null, 2) + "\n");
250
- }
243
+ else {
244
+ try {
245
+ const OC_CONFIG = TRINITY_OPENCODE_CONFIG || join(getOpenCodeHome(), "opencode.json");
246
+ if (existsSync(OC_CONFIG)) {
247
+ const oc = safeJsonParse(readFileSync(OC_CONFIG, "utf-8"));
248
+ const previousAgent = currentSel.previous_default_agent;
249
+ if (oc.default_agent === "plan" && previousAgent && previousAgent !== "plan") {
250
+ oc.default_agent = previousAgent;
251
+ writeFileSync(OC_CONFIG, JSON.stringify(oc, null, 2) + "\n");
252
+ writeSelection("previous_default_agent", null);
251
253
  }
252
254
  }
253
- catch { }
254
255
  }
256
+ catch { }
255
257
  }
256
258
  }
257
259
  catch { /* noop -- non-critical sync */ }
@@ -42,7 +42,7 @@ function safeJsonParse(raw) {
42
42
  throw e;
43
43
  }
44
44
  }
45
- const DFLT_SEL = { enabled: true, active_slot: null, thinking_level: "off", flow_enabled: false, tdd_enforce: false, tdd_strict: false, tdd_quality: true, flow_enforce: false, delegation_enforce: true, onboarding_mode: null, selected_provider: null, selected_quality_tier: null, selected_model: null, executed_provider: null, executed_quality_tier: null, executed_model: null };
45
+ const DFLT_SEL = { enabled: true, active_slot: null, thinking_level: "off", flow_enabled: false, tdd_enforce: false, tdd_strict: false, tdd_quality: true, flow_enforce: false, delegation_enforce: true, onboarding_mode: null, selected_provider: null, selected_quality_tier: null, selected_model: null, executed_provider: null, executed_quality_tier: null, executed_model: null, previous_default_agent: null };
46
46
  export function loadSelection() {
47
47
  const TIERS_FILE = join(getVibeOSHome(), "model-tiers.json");
48
48
  try {
@@ -73,6 +73,7 @@ export function loadSelection() {
73
73
  executed_provider: j?.selection?.executed_provider || null,
74
74
  executed_quality_tier: j?.selection?.executed_quality_tier || null,
75
75
  executed_model: j?.selection?.executed_model || null,
76
+ previous_default_agent: j?.selection?.previous_default_agent || null,
76
77
  };
77
78
  }
78
79
  catch {
@@ -753,7 +753,8 @@ export function createTrinityTool(deps) {
753
753
  if (_fp) {
754
754
  try {
755
755
  deps.ensureProjectSkill(deps.directory, _fp);
756
- } catch (_e) {}
756
+ }
757
+ catch (_e) { }
757
758
  }
758
759
  if (result.created.length === 0 && result.skipped.length > 0) {
759
760
  return `AGENTS.md and README.md already exist. Use \`trinity guard\` to check for missing features.`;