remove optchat

This commit is contained in:
2026-10-10 13:17:48 +02:00
parent d7f67f8d4f
commit c189a355c0
14 changed files with 17 additions and 1949 deletions
+4 -16
View File
@@ -23,7 +23,7 @@ const unrelated = {
},
},
};
const names = ["agents", "multi-work", "quota", "optchat"];
const names = ["agents", "multi-work", "quota"];
const empty = {
agents: {
"fast-lo": "",
@@ -99,7 +99,7 @@ async function contents(config: string) {
return JSON.parse(await readFile(join(config, "opencode.json"), "utf8"));
}
for (const selection of ["quota", "agents,multi-work,quota,optchat"]) {
for (const selection of ["quota", "agents,multi-work,quota"]) {
test(`installs valid subset ${selection}, preserving unrelated config and MCP`, async () => {
const f = await fixture();
await install(f.source, f.config, selection);
@@ -144,23 +144,18 @@ test("upgrades retain selection and options; explicit selection replaces only ow
test("installer writes empty option skeletons and subagent_depth, fills only missing keys, and is idempotent", async () => {
const f = await fixture();
await install(f.source, f.config, "agents,multi-work,quota,optchat");
await install(f.source, f.config, "agents,multi-work,quota");
const fresh = await contents(f.config);
expect(fresh.plugins.slice(1)).toEqual([
{ package: "./plugins/stanp-opencode/agents", options: empty },
{ package: "./plugins/stanp-opencode/multi-work" },
{ package: "./plugins/stanp-opencode/quota" },
{
package: "./plugins/stanp-opencode/optchat",
options: { compactionModel: "", dataDir: "" },
},
]);
expect(fresh.experimental).toEqual({ subagent_depth: 2 });
fresh.plugins[1].options = {
agents: { "fast-lo": "openai/gpt-6-luna#low" },
extra: 1,
};
fresh.plugins[4].options = { compactionModel: "acme/cheap" };
await writeFile(join(f.config, "opencode.json"), JSON.stringify(fresh));
await install(f.source, f.config);
const filled = await contents(f.config);
@@ -168,10 +163,6 @@ test("installer writes empty option skeletons and subagent_depth, fills only mis
agents: { ...empty.agents, "fast-lo": "openai/gpt-6-luna#low" },
extra: 1,
});
expect(filled.plugins[4].options).toEqual({
compactionModel: "acme/cheap",
dataDir: "",
});
expect(filled).toMatchObject(unrelated);
await install(f.source, f.config);
expect(await contents(f.config)).toEqual(filled);
@@ -225,10 +216,7 @@ test("replaces the legacy monolith without duplicates and retains Agents options
const result = await contents(f.config);
expect(result.plugins.map((entry: { package: string }) => entry.package)).toEqual([
"before",
// The monolith never had Optchat, so upgrading it does not add Optchat.
...names
.filter((name) => name !== "optchat")
.map((name) => `./plugins/stanp-opencode/${name}`),
...names.map((name) => `./plugins/stanp-opencode/${name}`),
"after",
]);
expect(result.plugins[1].options.agents["fast-lo"]).toBe("openai/gpt-6-luna#low");