Skip to content

release: v6.8.4 - #53

Merged
code-crusher merged 5 commits into
mainfrom
release/6.8.4
Sep 5, 2026
Merged

release: v6.8.4#53
code-crusher merged 5 commits into
mainfrom
release/6.8.4

Conversation

@code-crusher

Copy link
Copy Markdown
Member

Release v6.8.4

Fixed

  • Dynamic model catalog no longer prunes the user's current selection. fetchDynamicModels reconciles the registry against each backend response, but previously pruned any managed model not in the latest fetch — including the model the user had just selected. A transient backend gap (or a model temporarily missing from one /v1/models response) would delete it from AXON_MODELS, and the next loadSettings() would silently fall back to DEFAULT_MODEL_ID. The reconciliation now skips the currently selected model so a user's choice survives across /new, /resume, and mid-session usage refreshes.

Changed

  • TIP text under the spinner now renders in an info-purple color (#C792EA dark / #7C4DFF light) so it's clearly distinct from the thinking spinner. Added a new info theme token.
  • README screenshot now hosted on Cloudinary instead of a local assets/ file.

Chore

  • Version bumped to 6.8.4.

Checklist

  • npm run typecheck and npm run build pass
  • Version 6.8.4 not already on npm
  • Merge, then tag v6.8.4 on main to trigger publish

…tion

fetchDynamicModels previously pruned any managed model not in the latest
backend response, including the model the user had just selected. A transient
backend gap would silently delete it from AXON_MODELS and fall back to
DEFAULT_MODEL_ID. Now skips the currently selected model during reconciliation.
TIP text under the thinking spinner now uses a dedicated info color
(#C792EA dark / #7C4DFF light) instead of dim, making it visually distinct.
Adds a new info theme token to branding and both themes.
Removes the local assets/orbcode-screenshot.webp and points README to a
hosted image for better accessibility and repo size.
@matterai-app

matterai-app Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary By MatterAI MatterAI logo

🔄 What Changed

  • Bumped package version to v6.8.4 in package.json.
  • Implemented loadSettingsModel() in src/api/models.ts to synchronously read the user's selected model from disk (config.json) without triggering full settings-load side effects.
  • Updated model fetching reconciliation logic to ensure the user's current model selection is never pruned during dynamic model updates.
  • Added an info color token to branding and theme definitions (src/branding.ts, src/ui/theme.tsx) and integrated it into the Spinner component for tips.

🔍 Impact of the Change

  • Prevents user-selected AI models from being inadvertently wiped or swapped out during transient backend catalog refreshes.
  • Enhances TUI visual feedback by introducing a distinct information color token for loading tips.

📁 Total Files Changed

Click to Expand
File ChangeLog
Version Bump package.json Updated package version to 6.8.4.
Model Persistence src/api/models.ts Added loadSettingsModel() to protect user model selection from pruning.
Theme Branding src/branding.ts Added info color branding token.
UI Spinner src/ui/components/Spinner.tsx Applied theme info color to loading tips.
Theme Definitions src/ui/theme.tsx Defined info color values for dark and light themes.

🧪 Test Added/Recommended

Recommended

  • Add unit tests for loadSettingsModel() covering missing config files, invalid JSON, and valid model selection reads.
  • Add integration tests verifying that dynamic model reconciliation respects the user's current model selection.

🔒 Security Vulnerabilities

  • None detected.

@matterai-app matterai-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 PR Review is completed: Release bump plus a fix that preserves the user's selected model during dynamic-catalog pruning, and a new info theme token for spinner tips. The pruning guard only reads config.json, so selections made via settings.json or MATTERAI_MODEL are still vulnerable to being pruned.

Skipped files
  • CHANGELOG.md: Skipped file pattern
  • README.md: Skipped file pattern
  • assets/orbcode-screenshot.webp: File hunk diff too large
⬇️ Low Priority Suggestions (1)
src/api/models.ts (1 suggestion)

Location: src/api/models.ts (Lines 12-21)

🟡 Logic Error

Issue: loadSettingsModel() only reads config.json, but per loadSettings() in src/config/settings.ts, the effective model selection can also come from settings.json (user or project scope — model is in SETTINGS_KEYS) or the MATTERAI_MODEL env var, which takes precedence over all files. If a user's selected model is set via either of those paths and the backend catalog no longer lists it, the pruning loop at line 476 will still delete it from AXON_MODELS. The next loadSettings() then fails isValidAxonModel() and silently resets the user to DEFAULT_MODEL_ID — exactly the behavior this PR intends to prevent.

Fix: Check MATTERAI_MODEL first (it has highest precedence), then walk the same file precedence as loadSettings(): config.json, user settings.json, project .orbcode/settings.json, returning the first model found. Wrap each read in its own try/catch so a malformed config.json doesn't skip the settings.json candidates.

Impact: Guarantees the user's actual effective model selection is never pruned, regardless of where it was configured.

-  function loadSettingsModel(): string {
-    try {
-      const dir = process.env.MATTERAI_CONFIG_DIR || path.join(os.homedir(), ".orbcode")
-      const raw = fs.readFileSync(path.join(dir, "config.json"), "utf8")
-      const parsed = JSON.parse(raw)
-      return typeof parsed.model === "string" ? parsed.model : ""
-    } catch {
-      return ""
-    }
-  }
+  function loadSettingsModel(): string {
+    if (process.env.MATTERAI_MODEL) return process.env.MATTERAI_MODEL;
+    const dir = process.env.MATTERAI_CONFIG_DIR || path.join(os.homedir(), ".orbcode");
+    const candidates = [
+      path.join(dir, "config.json"),
+      path.join(dir, "settings.json"),
+      path.join(process.cwd(), ".orbcode", "settings.json"),
+    ];
+    for (const file of candidates) {
+      try {
+        const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
+        if (typeof parsed.model === "string") return parsed.model;
+      } catch {
+        // missing or malformed file — try the next candidate
+      }
+    }
+    return "";
+  }

@code-crusher
code-crusher merged commit 29ed7e4 into main Sep 5, 2026
1 check passed
@code-crusher
code-crusher deleted the release/6.8.4 branch September 5, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant