feat: introduce unified agent runtime config and system task prompt framework

- Add structured runtime config files (AGENT_PROFILE.md, AGENT_WORKFLOW.md, AGENT_HOOKS.md, USER_PREFERENCES.md, SYSTEM_TASKS.md, CURRENT_PERSONA.md) for persona, workflow, hooks, and system tasks
- Implement agent_runtime_manager to load, validate, and render runtime config and system task prompts
- Refactor agent initialization to use runtime-managed directories for skills, jobs, memory, and activity logs
- Add AgentHooksMiddleware for structured pre/in/post hooks injection
- Replace hardcoded system task prompts with template-driven rendering from SYSTEM_TASKS.md
- Update tests to cover runtime config loading, migration, and system task prompt rendering
- Update .gitignore to exclude config/agent/
This commit is contained in:
jxxghp
2026-04-28 13:04:28 +08:00
parent 483fe55372
commit c5b716c231
16 changed files with 1335 additions and 200 deletions
+7
View File
@@ -26,6 +26,13 @@ class TestAgentPromptStyle(unittest.TestCase):
prompt,
)
def test_prompt_uses_root_runtime_sections(self):
prompt = prompt_manager.get_agent_prompt()
self.assertIn("<agent_profile>", prompt)
self.assertIn("<agent_workflow>", prompt)
self.assertIn("Active persona: `default`", prompt)
def test_non_verbose_prompt_requires_silence_until_all_tools_finish(self):
with patch.object(settings, "AI_AGENT_VERBOSE", False):
prompt = prompt_manager.get_agent_prompt()