evOo-local/packages/adapters/src/product-self-modification.test.ts
cynarAI bc5f41ecb1 fix(adapters): route evOo self-modification requests to code tools (#91)
* fix(adapters): route evOo self-modification requests to code tools

Oos lacked product self-knowledge in their system instructions and were
steered toward browser/computer tools for UI text changes. Add explicit
guidance that evOo changes belong in source code (file/shell tools,
project/ when linked, cloud agent when configured), never via claude.ai
login or browser CSS injection.

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>

* fix(adapters): avoid space query that broke executor test mocks

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
2026-09-25 18:42:45 +02:00

38 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { formatProductSelfModificationInstruction } from "./product-self-modification.js";
describe("formatProductSelfModificationInstruction", () => {
it("steers evOo UI changes to source code, not browser or third-party login", () => {
const instruction = formatProductSelfModificationInstruction({
teamComputer: false,
cloudAgentEnabled: false,
});
expect(instruction).toContain("evOo");
expect(instruction).toMatch(/source code/i);
expect(instruction).toMatch(/read_file, write_file, and shell/);
expect(instruction).toMatch(/Do not use browser_\*/);
expect(instruction).toMatch(/never ask the user to sign in to claude\.ai/i);
expect(instruction).toMatch(/Claude Space/);
expect(instruction).toMatch(/update_bot only changes this bot's chat profile/);
});
it("mentions project/ on team computers", () => {
const instruction = formatProductSelfModificationInstruction({
teamComputer: true,
cloudAgentEnabled: false,
});
expect(instruction).toContain("project/");
});
it("mentions cloud_agent_launch when the tool is available", () => {
const instruction = formatProductSelfModificationInstruction({
teamComputer: false,
cloudAgentEnabled: true,
});
expect(instruction).toContain("cloud_agent_launch");
});
});