@bunshin-cc/bunshin 0.4.6 → 0.4.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.
Files changed (2) hide show
  1. package/dist/bin.js +9 -5
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -183,12 +183,13 @@ function renderIndex(lessons) {
183
183
  }
184
184
  return lines.join("\n") + "\n";
185
185
  }
186
- var DEFAULT_CONFIG, EMPTY_SESSION, Store;
186
+ var RETIRED_DEFAULT_MODELS, DEFAULT_CONFIG, EMPTY_SESSION, Store;
187
187
  var init_store = __esm({
188
188
  "src/store.ts"() {
189
189
  "use strict";
190
190
  init_frontmatter();
191
191
  init_util();
192
+ RETIRED_DEFAULT_MODELS = /* @__PURE__ */ new Set(["claude-fable-5-1"]);
192
193
  DEFAULT_CONFIG = {
193
194
  orgId: "local",
194
195
  userId: process.env.USER || "me",
@@ -199,7 +200,7 @@ var init_store = __esm({
199
200
  apiUrl: "",
200
201
  scope: "repo",
201
202
  harness: "claude-code",
202
- model: "claude-fable-5-1",
203
+ model: "claude-opus-5-5",
203
204
  gateModel: "claude-haiku-4-5-20251001",
204
205
  backend: "auto",
205
206
  recall: { enabled: true, maxLessons: 4, hookBudgetMs: 3500, useMothership: true },
@@ -267,6 +268,8 @@ var init_store = __esm({
267
268
  recall: { ...DEFAULT_CONFIG.recall, ...raw.recall ?? {} },
268
269
  reflect: { ...DEFAULT_CONFIG.reflect, ...raw.reflect ?? {} }
269
270
  };
271
+ if (RETIRED_DEFAULT_MODELS.has(merged.model)) merged.model = DEFAULT_CONFIG.model;
272
+ if (process.env.BUNSHIN_MODEL) merged.model = process.env.BUNSHIN_MODEL;
270
273
  const harness = process.env.BUNSHIN_HARNESS;
271
274
  if (harness === "claude-code" || harness === "codex" || harness === "pi" || harness === "other") merged.harness = harness;
272
275
  if (!merged.apiKey && merged.credentialFile) {
@@ -4439,9 +4442,9 @@ function episodeIdFor(contextId, sessionId) {
4439
4442
  return `e_${createHash2("sha256").update(`${contextId}
4440
4443
  ${sessionId}`).digest("hex").slice(0, 16)}`;
4441
4444
  }
4442
- function runClaudeFork(sessionId, prompt, { cwd, timeoutMs = FORK_TIMEOUT_MS } = {}) {
4445
+ function runClaudeFork(sessionId, prompt, { cwd, model, timeoutMs = FORK_TIMEOUT_MS } = {}) {
4443
4446
  const bin = process.env.BUNSHIN_CLAUDE_BIN || "claude";
4444
- const args = ["-p", "--resume", sessionId, "--fork-session", "--output-format", "json", prompt];
4447
+ const args = ["-p", "--resume", sessionId, "--fork-session", "--output-format", "json", ...model ? ["--model", model] : [], prompt];
4445
4448
  return new Promise((resolve) => {
4446
4449
  let out = "";
4447
4450
  let err = "";
@@ -4553,10 +4556,11 @@ async function runReflectionV2(store, opts) {
4553
4556
  const promptBase = { contextKind: view.ctx.kind, layers: view.layers, index, captured, ...opts.focus ? { focus: opts.focus } : {}, ...earlier ? { earlier } : {}, ...profile ? { profileId: profile.id } : {} };
4554
4557
  let raw = null;
4555
4558
  if (harness === "claude-code") {
4556
- const fork = await runClaudeFork(opts.sessionId, buildReflectPrompt(promptBase), { cwd: session.cwd });
4559
+ const fork = await runClaudeFork(opts.sessionId, buildReflectPrompt(promptBase), { cwd: session.cwd, model: config.model });
4557
4560
  v2.log("v2-reflect-fork", {
4558
4561
  session: opts.sessionId,
4559
4562
  ok: fork.ok,
4563
+ model: config.model,
4560
4564
  cache: true,
4561
4565
  cache_read_input_tokens: fork.usage?.cache_read_input_tokens ?? null,
4562
4566
  cache_creation_input_tokens: fork.usage?.cache_creation_input_tokens ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunshin-cc/bunshin",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Shared memory for company AI agents. Connect Codex, Claude Code, or Pi to Bunshin.",
5
5
  "type": "module",
6
6
  "bin": {