|
|
@@ -464,7 +464,7 @@ describe('config-io', () => {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
- test('disableDefaultAgents disables OpenCode built-in agents', () => {
|
|
|
+ test('disableDefaultAgents disables conflicting OpenCode built-in agents', () => {
|
|
|
const configPath = join(tmpDir, 'opencode', 'opencode.json');
|
|
|
paths.ensureConfigDir();
|
|
|
writeFileSync(configPath, JSON.stringify({}));
|
|
|
@@ -475,11 +475,11 @@ describe('config-io', () => {
|
|
|
const saved = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
|
expect(saved.agent.explore.disable).toBe(true);
|
|
|
expect(saved.agent.general.disable).toBe(true);
|
|
|
- expect(saved.agent.build.disable).toBe(true);
|
|
|
- expect(saved.agent.plan.disable).toBe(true);
|
|
|
+ expect(saved.agent.build).toBeUndefined();
|
|
|
+ expect(saved.agent.plan).toBeUndefined();
|
|
|
});
|
|
|
|
|
|
- test('disableDefaultAgents preserves existing built-in agent config', () => {
|
|
|
+ test('disableDefaultAgents preserves existing build and plan agent config', () => {
|
|
|
const configPath = join(tmpDir, 'opencode', 'opencode.json');
|
|
|
paths.ensureConfigDir();
|
|
|
writeFileSync(
|
|
|
@@ -496,14 +496,10 @@ describe('config-io', () => {
|
|
|
expect(result.success).toBe(true);
|
|
|
|
|
|
const saved = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
|
- expect(saved.agent.build).toEqual({
|
|
|
- description: 'custom build agent',
|
|
|
- disable: true,
|
|
|
- });
|
|
|
- expect(saved.agent.plan).toEqual({
|
|
|
- permission: { edit: 'deny' },
|
|
|
- disable: true,
|
|
|
- });
|
|
|
+ expect(saved.agent.build).toEqual({ description: 'custom build agent' });
|
|
|
+ expect(saved.agent.plan).toEqual({ permission: { edit: 'deny' } });
|
|
|
+ expect(saved.agent.explore.disable).toBe(true);
|
|
|
+ expect(saved.agent.general.disable).toBe(true);
|
|
|
});
|
|
|
|
|
|
test('enableLspByDefault sets lsp true when missing', () => {
|