add new agent components
This commit is contained in:
@@ -58,3 +58,24 @@ class AgentPromptingTests(unittest.TestCase):
|
||||
self.assertIn('Claw Code Python', prompt)
|
||||
self.assertIn('# System', prompt)
|
||||
self.assertIn('# Environment', prompt)
|
||||
|
||||
def test_prompt_builder_mentions_plugins_when_cache_is_loaded(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
workspace = Path(tmp_dir)
|
||||
plugin_cache = workspace / '.port_sessions' / 'plugin_cache.json'
|
||||
plugin_cache.parent.mkdir(parents=True, exist_ok=True)
|
||||
plugin_cache.write_text(
|
||||
'{"plugins":[{"name":"example-plugin","enabled":true}]}',
|
||||
encoding='utf-8',
|
||||
)
|
||||
runtime_config = AgentRuntimeConfig(cwd=workspace)
|
||||
model_config = ModelConfig(model='Qwen/Qwen3-Coder-30B-A3B-Instruct')
|
||||
prompt_context = build_prompt_context(runtime_config, model_config)
|
||||
parts = build_system_prompt_parts(
|
||||
prompt_context=prompt_context,
|
||||
runtime_config=runtime_config,
|
||||
tools=default_tool_registry(),
|
||||
)
|
||||
|
||||
prompt = render_system_prompt(parts)
|
||||
self.assertIn('# Plugins', prompt)
|
||||
|
||||
Reference in New Issue
Block a user