fix: generate agents with platform LLM grants
All checks were successful
build / build (push) Successful in 21s

This commit is contained in:
robert
2026-05-26 21:39:02 -03:00
parent 54b0788b82
commit 53ecc9a0cb
11 changed files with 74 additions and 40 deletions

View File

@@ -53,6 +53,17 @@ class BuilderPromptTests(unittest.TestCase):
self.assertIn(f"a2a-pack>={A2A_PACK_MIN_VERSION}", requirements)
self.assertIn("a2a-pack>={A2A_PACK_MIN_VERSION}", tools_source)
def test_prompt_defaults_generated_agents_to_platform_llm_grants(self) -> None:
self.assertIn("LLMProvisioning.PLATFORM", SYSTEM_PROMPT)
self.assertIn("caller_pays_llm=False", SYSTEM_PROMPT)
self.assertIn("main-agent handoffs mint a scoped A2A LiteLLM grant", SYSTEM_PROMPT)
self.assertIn("ctx.llm.api_key", SYSTEM_PROMPT)
files = _builder_skill_files()
self.assertIn("LLMProvisioning.PLATFORM", files["a2apack-agent-authoring/SKILL.md"])
self.assertIn("caller_pays_llm=False", files["a2apack-agent-authoring/SKILL.md"])
self.assertIn("ctx.llm.api_key", files["agent-quality-review/SKILL.md"])
def test_prompt_requires_resource_mirror_for_heavy_agents(self) -> None:
self.assertIn("declare resources in BOTH places", SYSTEM_PROMPT)
self.assertIn("resources = Resources", SYSTEM_PROMPT)

View File

@@ -31,7 +31,7 @@ class TemplateInitTests(unittest.TestCase):
self.assertEqual(set(files), {"agent.py", "a2a.yaml", "requirements.txt"})
self.assertIn('name = "research-agent"', files["agent.py"])
self.assertIn('description = "Research helper"', files["agent.py"])
self.assertIn("LLMProvisioning.CALLER_PROVIDED", files["agent.py"])
self.assertIn("LLMProvisioning.PLATFORM", files["agent.py"])
self.assertIn("WorkspaceAccess.dynamic", files["agent.py"])
self.assertIn("RUNTIME_SKILLS_DIR", files["agent.py"])
self.assertIn("_runtime_skills_root", files["agent.py"])