[PR #659] [MERGED] beholder: manage the local model, and say which one is answering #1076

Closed
opened 2026-10-21 05:02:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/659
Author: @GetBeholder
Created: 8/30/2026
Status: ✅ Merged
Merged: 8/30/2026
Merged by: @GetBeholder

Base: staging ← Head: feat/beholder-local-model-slot


📝 Commits (10+)

  • 1840892 beholder: port the slot editor, locks, Doctor and Help
  • 22a8066 beholder: make locks enforce, not just mark
  • 2a67bee test(beholder): cover attribution when several characters are tracked
  • d9f0da1 beholder: make the panel usable before the first extraction
  • 073e293 beholder: manage the local model, and say which one is answering
  • 8893606 beholder: satisfy prettier on the local-model views
  • f31832f beholder: review fixes for the editor, locks and views
  • b814ac4 Merge remote-tracking branch 'origin/staging' into feat/beholder-local-model-slot
  • a5569b8 beholder: resolve the chat the same way when reading and writing the prompt
  • 19c710d beholder: bind the prompt save to the chat the view is showing

📊 Changes

11 files changed (+865 additions, -63 deletions)

View changed files

➕ artifacts/beholder-1.3.7.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 packages/beholder/client.js (+346 -22)
📝 packages/beholder/manifest.json (+3 -3)
➕ packages/beholder/src/55-sidecar.js (+84 -0)
📝 packages/beholder/src/60-views.js (+257 -19)
📝 packages/beholder/src/style.css (+24 -0)
📝 scripts/build-beholder-package.mjs (+1 -1)
📝 tests/beholder-client-contract.regression.ts (+132 -0)

📄 Description

Pull request

Linked issue

Closes #658

Why this change

Beholder is answered either by a general model through the agent's connection or by the small trained extractor in the engine's local model slot. The two need different prompts — five short per-lane calls versus one long one — and pairing either with the other's prompt degrades extraction badly.

The slot outranks the agent's connection server-side, and it does so silently. The Prompt view was inferring the model from the connection list, which is the wrong answer whenever the slot is serving. A bad extraction then reads as a bad model rather than a wrong setting.

What changed

  • Says which connection is answering. Asks the engine's routing endpoint rather than inferring: which model, which version, and when it is not the local one, the reason why not.
  • Locks the prompt when the local model answers. The five-pass template is selected and the picker disabled, because at that point there is exactly one correct choice and an open picker only lets someone break their own setup. When the agent connection answers, the existing mismatch warning still applies.
  • Model management, in the prompt view — install, enable, disable, and an update check. Choosing the model and choosing the prompt are one decision, so they are one screen.
  • Update honesty. Versions are compared by blob id, not file size. When the comparison cannot be made the UI says "could not tell", not "up to date" — the user is being asked to spend a download.
  • Hardware settings — CPU or GPU offload, context, parallel slots. Not sampling: that is fixed to what the model was trained with, and a temperature dial on a schema-graded extractor is a footgun.

Degrades quietly: an engine without the slot answers 404 to the status probe, the package stops asking, and behaviour is unchanged.

Package and security impact

  • Affected package IDs: beholder (1.3.6 → 1.3.7)
  • Engine compatibility impact: requires Pasta-Devs/Marinara-Engine#5678, which adds the slot and its API (merged). Without it the new UI is simply absent.
  • New or changed permissions/entrypoints: none — same ui permission, same client entrypoint. All calls are same-origin to /api/utility-sidecar.
  • Restart, storage, update, or uninstall impact: none new for the package. Model install and hardware changes affect the engine's utility slot only; the engine's own sidecar is untouched.

Validation

  • node scripts/validate-catalog.mjs passes
  • git diff --check passes
  • Rebuilt manifest, payload, artifact and catalog entry
  • Contract regression extended and passing
  • Ran the whole feature end to end against a real Engine on an isolated DATA_DIR (server side; see below)
  • Clicked the new UI through in a browser
  • Checked uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

The server side this UI drives was exercised end to end against a real Engine on an isolated DATA_DIR: a real 811 MB install from HuggingFace through the route, path-traversal and bad-input rejections over HTTP, an update check against the live repo, the slot starting on its own port with max GPU offload, and a real five-pass Beholder agent run answered entirely by the local model — with the main sidecar's config, model file and runtime record byte-for-byte unchanged (sha256) throughout.

What is not done is clicking the new controls in a browser. That box stays unticked.

Automated coverage added to tests/beholder-client-contract.regression.ts: the banner in both directions — including that it does not name the agent connection's model while the local slot is answering, which would point the user at the wrong thing; version labelling in all three states (installed, no oid, absent); the not-installed branch warning about a missing runtime and stating that the engine's own sidecar is unaffected; the installed-and-serving branch offering stop rather than a second install; that no sampling control appears in the hardware form; that current values round-trip into it, so saving cannot silently reset them; and that server-supplied strings — repo name, file name, routing reason — are escaped before reaching markup, on the same reasoning as the earlier title= escaping fixes.

Also confirmed the build is deterministic: rebuilding the parent branch reproduced its committed artifacts byte-for-byte.

Documentation impact

  • No documentation changes needed

UI evidence (if applicable)

None captured — see above.

Summary by CodeRabbit

  • New Features

    • Added local Beholder model status, routing, installation, activation, update, and hardware settings controls.
    • Prompt view now indicates whether responses come from the local model or agent connection.
    • Automatically selects and locks the five-pass prompt when the local model is active.
    • Added clearer connection indicators, model status badges, and action feedback.
  • Bug Fixes

    • Improved handling of unavailable local model services and operation errors.
    • Improved prompt saving when chat context is provided through the dock.
  • Chores

    • Released Beholder version 1.3.7 with updated package metadata.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/659 **Author:** [@GetBeholder](https://github.com/GetBeholder) **Created:** 8/30/2026 **Status:** ✅ Merged **Merged:** 8/30/2026 **Merged by:** [@GetBeholder](https://github.com/GetBeholder) **Base:** `staging` ← **Head:** `feat/beholder-local-model-slot` --- ### 📝 Commits (10+) - [`1840892`](https://github.com/Pasta-Devs/Marinara-Agents/commit/18408923e0fd7d988ed3fa0f7116d561877b8064) beholder: port the slot editor, locks, Doctor and Help - [`22a8066`](https://github.com/Pasta-Devs/Marinara-Agents/commit/22a80669fde0aec41c11473f53e08b6f55e51650) beholder: make locks enforce, not just mark - [`2a67bee`](https://github.com/Pasta-Devs/Marinara-Agents/commit/2a67bee49079d27509a4ea6589fa39520367ec8a) test(beholder): cover attribution when several characters are tracked - [`d9f0da1`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d9f0da1fc8f2abd8b4be8cb45f6d3bf9c769060c) beholder: make the panel usable before the first extraction - [`073e293`](https://github.com/Pasta-Devs/Marinara-Agents/commit/073e293713bf8aa478e1c4e4a47cdf35d73524ef) beholder: manage the local model, and say which one is answering - [`8893606`](https://github.com/Pasta-Devs/Marinara-Agents/commit/889360678f3049b1c39e593ca01674837dee0ba9) beholder: satisfy prettier on the local-model views - [`f31832f`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f31832f5bb022a38ac240e4176ac1bacc13d5a17) beholder: review fixes for the editor, locks and views - [`b814ac4`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b814ac49f17c6552d247e9c4059b775d834863f8) Merge remote-tracking branch 'origin/staging' into feat/beholder-local-model-slot - [`a5569b8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a5569b810ca74bd60bacb9aef76c5f6abf72ed7e) beholder: resolve the chat the same way when reading and writing the prompt - [`19c710d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/19c710df3d98f9096e2a23d539c42522a8aff89a) beholder: bind the prompt save to the chat the view is showing ### 📊 Changes **11 files changed** (+865 additions, -63 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/beholder-1.3.7.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `packages/beholder/client.js` (+346 -22) 📝 `packages/beholder/manifest.json` (+3 -3) ➕ `packages/beholder/src/55-sidecar.js` (+84 -0) 📝 `packages/beholder/src/60-views.js` (+257 -19) 📝 `packages/beholder/src/style.css` (+24 -0) 📝 `scripts/build-beholder-package.mjs` (+1 -1) 📝 `tests/beholder-client-contract.regression.ts` (+132 -0) </details> ### 📄 Description # Pull request ## Linked issue Closes #658 ## Why this change Beholder is answered either by a general model through the agent's connection or by the small trained extractor in the engine's local model slot. The two need different prompts — five short per-lane calls versus one long one — and pairing either with the other's prompt degrades extraction badly. The slot outranks the agent's connection server-side, and it does so silently. The Prompt view was inferring the model from the connection list, which is the wrong answer whenever the slot is serving. A bad extraction then reads as a bad model rather than a wrong setting. ## What changed - **Says which connection is answering.** Asks the engine's routing endpoint rather than inferring: which model, which version, and when it is not the local one, the reason why not. - **Locks the prompt when the local model answers.** The five-pass template is selected and the picker disabled, because at that point there is exactly one correct choice and an open picker only lets someone break their own setup. When the agent connection answers, the existing mismatch warning still applies. - **Model management, in the prompt view** — install, enable, disable, and an update check. Choosing the model and choosing the prompt are one decision, so they are one screen. - **Update honesty.** Versions are compared by blob id, not file size. When the comparison cannot be made the UI says "could not tell", not "up to date" — the user is being asked to spend a download. - **Hardware settings** — CPU or GPU offload, context, parallel slots. Not sampling: that is fixed to what the model was trained with, and a temperature dial on a schema-graded extractor is a footgun. Degrades quietly: an engine without the slot answers 404 to the status probe, the package stops asking, and behaviour is unchanged. ## Package and security impact - Affected package IDs: `beholder` (1.3.6 → 1.3.7) - Engine compatibility impact: **requires Pasta-Devs/Marinara-Engine#5678**, which adds the slot and its API (merged). Without it the new UI is simply absent. - New or changed permissions/entrypoints: none — same `ui` permission, same client entrypoint. All calls are same-origin to `/api/utility-sidecar`. - Restart, storage, update, or uninstall impact: none new for the package. Model install and hardware changes affect the engine's utility slot only; the engine's own sidecar is untouched. ## Validation - [x] `node scripts/validate-catalog.mjs` passes - [x] `git diff --check` passes - [x] Rebuilt manifest, payload, artifact and catalog entry - [x] Contract regression extended and passing - [x] Ran the whole feature end to end against a real Engine on an isolated DATA_DIR (server side; see below) - [ ] Clicked the new UI through in a browser - [ ] Checked uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes The server side this UI drives was exercised end to end against a real Engine on an isolated `DATA_DIR`: a real 811 MB install from HuggingFace through the route, path-traversal and bad-input rejections over HTTP, an update check against the live repo, the slot starting on its own port with max GPU offload, and a real five-pass Beholder agent run answered entirely by the local model — with the main sidecar's config, model file and runtime record byte-for-byte unchanged (sha256) throughout. What is **not** done is clicking the new controls in a browser. That box stays unticked. Automated coverage added to `tests/beholder-client-contract.regression.ts`: the banner in both directions — including that it does *not* name the agent connection's model while the local slot is answering, which would point the user at the wrong thing; version labelling in all three states (installed, no oid, absent); the not-installed branch warning about a missing runtime and stating that the engine's own sidecar is unaffected; the installed-and-serving branch offering stop rather than a second install; that no sampling control appears in the hardware form; that current values round-trip into it, so saving cannot silently reset them; and that server-supplied strings — repo name, file name, routing reason — are escaped before reaching markup, on the same reasoning as the earlier `title=` escaping fixes. Also confirmed the build is deterministic: rebuilding the parent branch reproduced its committed artifacts byte-for-byte. ## Documentation impact - [x] No documentation changes needed ## UI evidence (if applicable) None captured — see above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added local Beholder model status, routing, installation, activation, update, and hardware settings controls. * Prompt view now indicates whether responses come from the local model or agent connection. * Automatically selects and locks the five-pass prompt when the local model is active. * Added clearer connection indicators, model status badges, and action feedback. * **Bug Fixes** * Improved handling of unavailable local model services and operation errors. * Improved prompt saving when chat context is provided through the dock. * **Chores** * Released Beholder version 1.3.7 with updated package metadata. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:02:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1076
No description provided.