Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(models): the chat_model behavior row says a stored DB-plane model now runs and can change spend (#6795)
time-attack32ba5b250adf
diff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsvindex 0806f4c7ae..e15e73f620 100644--- a/scripts/structural-suites.tsv+++ b/scripts/structural-suites.tsv@@ -123,6 +123,7 @@ test/doctor-skills-dir.test.ts doctor --skills-dir (#4673) 6 readFileSynctest/doctor-supervisor-singleton-pidfile.test.ts doctor supervisor_singleton — honors the recorded pid_file (custom --pid-file) 2 doctor-source-helpertest/doctor-supervisor-singleton-pidfile.test.ts doctor supervisor_singleton — pid_file fallback (source-grep) 1 doctor-source-helpertest/doctor-volunteer-channels.test.ts checkVolunteerChannels 9 doctor-source-helper,readFileSync,source-surface-helper+test/doctor-wedged-queue.test.ts issue #1801 fix #3 — computeWedgedQueueCheck 14 doctor-source-helpertest/doctor-wedged-queue.test.ts issue #1801 fix #3 — remote queue_health state→status regression 1 doctor-source-helpertest/doctor.test.ts BUG 4 — in-progress sync via live lock, not stale freshness 8 doctor-source-helpertest/doctor.test.ts doctor command 35 doctor-source-helperdiff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex aed47c0700..3c5019cdb8 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -944,7 +944,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;{ since: '0.60.312.0', text: '`gbrain apply-migrations --list` now shows v0.53.0 as `applied_pending_host_work` instead of `applied` while its stored shared-skills report still names host work (a source\'s inventory, writer, projection or publication-policy stage, or a brain-level pending action), and no longer prints "All migrations up to date" for it; `--list --json` rows carry that status and an `applied_pending_host_work` array whose fix is the read-only `gbrain apply-migrations --migration 0.53.0 --dry-run --json` inventory. Scripts that match `applied` should accept both. `gbrain doctor` warns on `minions_migration` (`details.code: migration_host_work_pending`) until a later `gbrain apply-migrations --yes` re-check finds the work done. Unenrolled members (every new brain), sources that opted out and a declined migration are never reported.' },{ since: '0.60.312.0', text: 'A queued job under a cost cap you set that calls a model with a registered price but no known context-token ceiling (OpenRouter models) now stops with `no_context_ceiling` instead of `no_pricing`. The message says the price is already known; the fix asks before rerunning without your cap (`--yes` in place of `--max-usd`), or asks for the model\'s context size for the brain-host operator. Under a default or derived cap the warning names the missing ceiling. Nothing else changed: no provider call is made either way.' },{ since: '0.60.312.0', text: 'A `claude-cli:` chat call capped at 1024 output tokens or fewer (the `gbrain models doctor` probe, query intent, fact classification, decisions, calibration and grading calls) now runs with Claude Code\'s thinking turned off (`MAX_THINKING_TOKENS=0`), because the API needs a thinking budget of at least 1024 tokens below the cap; those calls failed with a 400 before. The call reports `thinking: \'disabled_below_floor\'` in its claude-cli provider metadata. Calls with a larger cap are unchanged.' },- { since: '0.60.312.0', text: 'A database-plane `chat_model` or `expansion_model` (`gbrain config set chat_model …`) now selects the model when no `models.*` key, `GBRAIN_MODEL`, `GBRAIN_CHAT_MODEL` / `GBRAIN_EXPANSION_MODEL` or config.json pin outranks it; before, the gateway ignored it and used the built-in default. Its provenance reads `config_key` / `chat_model`. When one of those does outrank the write, `config set` still stores it but warns, naming the key, variable or file (never its value) and the fix (`gbrain config unset <models key>`, the new `gbrain config unset chat_model --file`, or unsetting the variable); `config set chat_model|expansion_model … --json` reports `effective` and `shadowed_by`.' },+ { since: '0.60.312.0', text: 'A database-plane `chat_model` or `expansion_model` (`gbrain config set chat_model …`) now selects the model when no `models.*` key, `GBRAIN_MODEL`, `GBRAIN_CHAT_MODEL` / `GBRAIN_EXPANSION_MODEL` or config.json pin outranks it; before, the gateway ignored a stored value and used the built-in default. So a brain that stored a `chat_model` or `expansion_model` earlier now runs that model after upgrading, which can change which model runs and therefore what each chat call spends; check with `gbrain models` and remove it with `gbrain config unset chat_model` to keep the default. Its provenance reads `config_key` / `chat_model`. When one of those does outrank the write, `config set` still stores it but warns, naming the key, variable or file (never its value) and the fix (`gbrain config unset <models key>`, the new `gbrain config unset chat_model --file`, or unsetting the variable); `config set chat_model|expansion_model … --json` reports `effective` and `shadowed_by`.' },{ since: '0.60.312.0', text: 'A name written only in Katakana (an alias such as デン) no longer links a page that has it inside a longer Katakana word (インシデント, デンタル): the name must stand as a whole Katakana run, so 「デン」, デンに, 喫茶デン and デン・カフェ still link. A short name inside a real Katakana compound is refused too; add the compound as its own alias when it names the entity. Mention links already written that way are counted by `gbrain doctor` (`stale_mentions`) and removed by `gbrain extract links --by-mention --rebuild --source db`.', id: 'katakana_mention_boundaries' },{ since: '0.60.312.0', text: 'On Windows, cancelling or timing out a job now ends its whole process tree with taskkill: a per-job child and a shell job first get a polite close (`taskkill /T`), then a forced one (`/T /F`) after the grace window, instead of only the direct child being killed. A windowless console program refuses the polite close, so a cancelled Windows shell job now takes up to its 5-second grace window to end. A descendant whose parent already exited is no longer in the tree and is not ended.', id: 'windows_tree_kill' },{ since: '0.60.312.0', text: '`get_links` and `get_backlinks` (`gbrain links`, `gbrain backlinks`) now return at most 500 link rows per call instead of every edge of the page. When more match, the last row carries `truncated: true` and `next_cursor`: pass it back as `cursor` (`--cursor`) with the same filters for the next rows, raise `limit` (`--limit`, up to 5000), or use `--all` on the CLI for every row. Remote callers also get a `listing_truncated` notice naming the next call. Rows come in link order, `link_type` and the live/history filter apply before the cap so hidden former relationships never use a row, and each row\'s `context` is cut to 2000 characters (ending in an ellipsis). A cursor from another listing is refused `link_cursor_invalid`. `get_backlinks` with `limit` no longer points at `group: "page"`; it pages the rows with `cursor`.', id: 'link_read_cap' },diff --git a/test/behavior-change-wave20-lane3.test.ts b/test/behavior-change-wave20-lane3.test.tsnew file mode 100644index 0000000000..fa8ce02171--- /dev/null+++ b/test/behavior-change-wave20-lane3.test.ts@@ -0,0 +1,20 @@+/**+ * Wave 20 review: the lane-3 spend changes each carry a BEHAVIOR_CHANGES row+ * that says what now costs money, so the upgrade notice warns before the+ * first paid run.+ */+import { describe, expect, test } from 'bun:test';+import { BEHAVIOR_CHANGES } from '../src/core/behavior-change-notice.ts';++const rows = BEHAVIOR_CHANGES.map((c) => String(c.text));+const find = (needle: string) => rows.filter((t) => t.includes(needle));++describe('wave 20 lane 3 spend rows', () => {+ test('a stored DB-plane chat_model now takes effect and can change the model and spend', () => {+ const [row] = find('database-plane `chat_model`');+ expect(row).toBeDefined();+ expect(row).toContain('before, the gateway ignored');+ expect(row).toMatch(/change which model runs/);+ expect(row).toMatch(/spend/);+ });+});