Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(behavior-notice): the embedding opt-out is a v0.60.77.0 BEHAVIOR_CHANGES row; upgrade cases run at the newest release

garrytana0741c378758
diff --git a/test/behavior-change-notice.test.ts b/test/behavior-change-notice.test.ts
index 40711932a4..ce1676a62a 100644
--- a/test/behavior-change-notice.test.ts
+++ b/test/behavior-change-notice.test.ts
@@ -230,7 +230,7 @@ for (const backend of testBackends()) {
expect(await takeLocalBehaviorNotice(engine, 'cli', { cfg: null, brainKey: 'doctor' })).not.toBeNull();
const again = await checkBehaviorChanges(engine, { cfg: null, brainKey: 'doctor' });
expect(again.details).toMatchObject({ shown: { cli: true, stdio: false } });
- expect(again.message).toContain('gbrain v0.60.68.0 and v0.60.74.0 changed 9 behaviors');
+ expect(again.message).toContain('gbrain v0.60.68.0, v0.60.74.0 and v0.60.77.0 changed 10 behaviors');
});
});
@@ -301,7 +301,7 @@ describe('per-release content', () => {
expect(later.why).not.toContain('chat_fallback_chain is live');
expect(later.fix?.argv).toEqual(['gbrain', 'doctor', '--only', 'behavior_changes', '--json']);
const all = behaviorChangesNotice(chain)!;
- expect(all.why).toContain('gbrain v0.60.68.0 and v0.60.74.0 changed 10 behaviors');
+ expect(all.why).toContain('gbrain v0.60.68.0, v0.60.74.0 and v0.60.77.0 changed 11 behaviors');
expect(all.fix?.argv).toEqual(['unset', 'GBRAIN_CHAT_FALLBACK_CHAIN']);
});
});
@@ -330,6 +330,7 @@ describe('concurrent initializations', () => {
describe('upgrades across releases (each step a new process pinned to a gbrain VERSION)', () => {
const modulePath = join(import.meta.dir, '..', 'src', 'core', 'behavior-change-notice.ts');
const WAVE9 = '`setsid`';
+ const OPT_OUT = 'no longer send text to an embedding provider';
const V68 = 'cycle.lint_fix false';
/** One gbrain process at `version`: takes the notice on `channel` (`http:<client>` for an HTTP client) for brain `key`. */
@@ -364,8 +365,8 @@ describe('upgrades across releases (each step a new process pinned to a gbrain V
test('a brain that saw the notice gets nothing from a later release that adds no behavior changes', async () => {
const home = freshHome();
for (const channel of ['cli', 'http:client-a']) {
- expect(await runAt(home, '0.60.74.0', 'seen', channel)).toContain(WAVE9);
- expect(await runAt(home, '0.60.74.0', 'seen', channel)).toBeNull();
+ expect(await runAt(home, '0.60.77.0', 'seen', channel)).toContain(OPT_OUT);
+ expect(await runAt(home, '0.60.77.0', 'seen', channel)).toBeNull();
expect(await runAt(home, '0.60.99.0', 'seen', channel)).toBeNull();
}
}, 60_000);
@@ -377,24 +378,26 @@ describe('upgrades across releases (each step a new process pinned to a gbrain V
writeFileSync(join(noticeDir(home), 'behavior_changes_0.60.68.0.b68.cli.shown'), '2026-10-05T00:00:00.000Z\n');
writeFileSync(join(home, 'brain-config.json'), JSON.stringify({ [HTTP_SHOWN_KEY]: JSON.stringify({ id: '[email protected]', clients: { 'client-a': '2026-10-05T00:00:00.000Z' } }) }));
for (const channel of ['cli', 'http:client-a']) {
- const why = await runAt(home, '0.60.74.0', 'b68', channel);
- expect(why).toContain('gbrain v0.60.74.0 changed 6 behaviors');
+ const why = await runAt(home, '0.60.77.0', 'b68', channel);
+ expect(why).toContain('gbrain v0.60.74.0 and v0.60.77.0 changed 7 behaviors');
expect(why).toContain(WAVE9);
+ expect(why).toContain(OPT_OUT);
expect(why).not.toContain(V68);
expect(why).not.toContain('v0.60.68.0');
- expect(await runAt(home, '0.60.74.0', 'b68', channel)).toBeNull();
- expect(await runAt(home, '0.60.75.0', 'b68', channel)).toBeNull();
+ expect(await runAt(home, '0.60.77.0', 'b68', channel)).toBeNull();
+ expect(await runAt(home, '0.60.78.0', 'b68', channel)).toBeNull();
}
}, 60_000);
test('a brain older than 0.60.68 sees every item, labeled with its release, once', async () => {
const home = freshHome();
for (const channel of ['cli', 'stdio', 'http:client-a']) {
- const why = await runAt(home, '0.60.74.0', 'old', channel);
- expect(why).toContain('gbrain v0.60.68.0 and v0.60.74.0 changed 9 behaviors');
+ const why = await runAt(home, '0.60.77.0', 'old', channel);
+ expect(why).toContain('gbrain v0.60.68.0, v0.60.74.0 and v0.60.77.0 changed 10 behaviors');
expect(why).toContain(`v0.60.68.0: (1) On a managed brain`);
expect(why).toContain(`v0.60.74.0: (4) A shell job`);
- expect(await runAt(home, '0.60.74.0', 'old', channel)).toBeNull();
+ expect(why).toContain(`v0.60.77.0: (10) On a brain with embedding turned off`);
+ expect(await runAt(home, '0.60.77.0', 'old', channel)).toBeNull();
expect(await runAt(home, '0.60.99.0', 'old', channel)).toBeNull();
}
expect(readFileSync(join(noticeDir(home), 'old.baseline'), 'utf8').trim()).toBe('0');
@@ -403,9 +406,9 @@ describe('upgrades across releases (each step a new process pinned to a gbrain V
test('a fresh brain sees nothing, then or after later upgrades', async () => {
const home = freshHome();
for (const channel of ['cli', 'http:client-a']) {
- expect(await runAt(home, '0.60.74.0', 'new', channel, { createdAgoMs: 0 })).toBeNull();
+ expect(await runAt(home, '0.60.77.0', 'new', channel, { createdAgoMs: 0 })).toBeNull();
expect(await runAt(home, '0.60.99.0', 'new', channel, { createdAgoMs: 2 * DAY })).toBeNull();
}
- expect(readFileSync(join(noticeDir(home), 'new.baseline'), 'utf8').trim()).toBe('0.60.74.0');
+ expect(readFileSync(join(noticeDir(home), 'new.baseline'), 'utf8').trim()).toBe('0.60.77.0');
}, 60_000);
});