Implemented the next missing parity slice around agent configurations.

This commit is contained in:
Abdelrahman Abdallah
2026-04-17 05:03:19 +02:00
parent fabbda53a5
commit 02674ba594
14 changed files with 721 additions and 17 deletions
+30
View File
@@ -4,6 +4,7 @@ import tempfile
import unittest
import json
import sys
import os
from pathlib import Path
from unittest.mock import patch
@@ -119,6 +120,35 @@ class AgentSlashCommandTests(unittest.TestCase):
self.assertIn('Hard input limit', result.final_output)
self.assertIn('Auto-compact buffer', result.final_output)
def test_agents_command_lists_and_shows_custom_agents(self) -> None:
with tempfile.TemporaryDirectory() as home_dir, tempfile.TemporaryDirectory() as tmp_dir:
workspace = Path(tmp_dir)
agents_dir = workspace / '.claude' / 'agents'
agents_dir.mkdir(parents=True)
(agents_dir / 'reviewer.md').write_text(
(
'---\n'
'name: reviewer\n'
'description: "Review implementation changes carefully."\n'
'tools: read_file, grep_search\n'
'model: test-child-model\n'
'---\n\n'
'Inspect code changes and summarize risks.\n'
),
encoding='utf-8',
)
with patch.dict(os.environ, {'HOME': home_dir}):
agent = LocalCodingAgent(
model_config=ModelConfig(model='test-model'),
runtime_config=AgentRuntimeConfig(cwd=workspace),
)
list_result = agent.run('/agents')
detail_result = agent.run('/agents show reviewer')
self.assertIn('# Agents', list_result.final_output)
self.assertIn('reviewer [projectSettings]', list_result.final_output)
self.assertIn('# Agent: reviewer', detail_result.final_output)
self.assertIn('Inspect code changes and summarize risks.', detail_result.final_output)
def test_mcp_and_resource_commands_render_local_reports(self) -> None:
with tempfile.TemporaryDirectory() as tmp_dir:
workspace = Path(tmp_dir)