Integrate reviewed full action pack admission and bounded idle scheduling

This commit is contained in:
zenord
2026-10-13 07:19:34 +08:00
parent 97f87e2409
commit f0620ddd65
21 changed files with 285 additions and 75 deletions
+10 -1
View File
@@ -6,7 +6,8 @@ import unittest
from pathlib import Path
import httpx
from action_protocol import ActionPlans, negotiate
from action_protocol import ActionPlans, negotiate, configured_packs
from unittest.mock import patch
from action_reply import parse_action_reply
from gateway import Dialogue
from history import History
@@ -30,6 +31,14 @@ RAW=json.dumps(dict(emotion='happy',intensity=1,reply='好呀。',action='dance'
class ActionProtocolTests(unittest.TestCase):
def test_unknown_capability_and_independent_review_allowlist(self):
full='987e125a7d7a2cde99121b5f5246c82f4dbe36c4899d3d49eaffd1a68bafb887'
with patch.dict('os.environ',{'LAN_ACTION_PACKS':'{}'}):
reviewed=configured_packs()
self.assertEqual(reviewed[full],{'asset_01':10042,'asset_02':10042})
self.assertIsNone(negotiate({'action_protocol':1,'action_kinds':['dance'],'action_pack_sha256':
'e73f336123bf5e2dec2d82b97eb22cc632a4ee75bcf7f4bd0052b1ff42d95cd7'},reviewed))
self.assertEqual(negotiate({'action_protocol':1,'action_kinds':['dance'],'action_pack_sha256':full},reviewed)[0],full)
with patch.dict('os.environ',{'LAN_ACTION_PACKS':'[]'}):self.assertEqual(configured_packs(),{})
configured={SHA:PACK[1]}
for hello in ({},{'action_protocol':1},{'action_protocol':2,'action_kinds':['dance'],'action_pack_sha256':SHA},
{'action_protocol':1,'action_kinds':['dance'],'action_pack_sha256':'b'*64}):