feat: add persona-owned agent limbs and Light Lake routing
This commit is contained in:
parent
43be75b60a
commit
8242c6dfc4
34 changed files with 2300 additions and 10 deletions
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env python3
|
||||
import json
|
||||
import pathlib
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from persona_limb_agent import codex_succeeded, qwen_succeeded
|
||||
|
||||
script = pathlib.Path(__file__).with_name("persona_limb_agent.py")
|
||||
|
||||
|
||||
def run(*args):
|
||||
return subprocess.run([sys.executable, str(script), *args], capture_output=True, text=True)
|
||||
|
||||
|
||||
probe = run("probe")
|
||||
assert probe.returncode == 0
|
||||
probe_body = json.loads(probe.stdout)
|
||||
assert probe_body["secrets_read"] is False
|
||||
assert probe_body["runtimes"]["qwen"]["available"] is True
|
||||
|
||||
prepared = run("prepare", "--persona", "ICE-P-ZY001", "--task-id", "TEST-001", "--task", "只读返回当前目录", "--runtime", "qwen")
|
||||
assert prepared.returncode == 0
|
||||
body = json.loads(prepared.stdout)
|
||||
assert body["parent_persona_id"] == "ICE-P-ZY001"
|
||||
assert body["controller"] == "ICE-P-ZY001"
|
||||
assert body["authority"] == "CURRENT_TASK_ENVELOPE_ONLY"
|
||||
|
||||
unknown = run("prepare", "--persona", "UNKNOWN-PERSONA", "--task-id", "TEST-002", "--task", "不得执行", "--runtime", "qwen")
|
||||
assert unknown.returncode != 0
|
||||
assert json.loads(unknown.stdout)["error"] == "PERSONA_NOT_REGISTERED_NO_SYNTHETIC_WAKE"
|
||||
|
||||
fake_api_error = subprocess.CompletedProcess([], 0, '[{"type":"result","is_error":false,"result":"[API Error: 403 denied]"}]', '')
|
||||
assert qwen_succeeded(fake_api_error) is False
|
||||
fake_success = subprocess.CompletedProcess([], 0, '[{"type":"result","is_error":false,"result":"{\\"outcome\\":\\"PASS\\"}"}]', '')
|
||||
assert qwen_succeeded(fake_success) is True
|
||||
fake_codex = subprocess.CompletedProcess([], 0, '{"type":"item.completed","item":{"type":"agent_message","text":"done"}}\n', '')
|
||||
assert codex_succeeded(fake_codex) is True
|
||||
|
||||
print("persona execution limb agent tests: PASS")
|
||||
Loading…
Reference in a new issue