Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a03397-4d51-7fd1-8ff2-946eb22ea2bc
This commit is contained in:
parent
7b3eff4a47
commit
2983fe6551
12 changed files with 203 additions and 7 deletions
|
|
@ -19,3 +19,36 @@ def test_broker_accepts_hash_address_alias(tmp_path):
|
|||
assert row["sender_repo"] == "net-kingdom"
|
||||
assert row["target_repo"] == "railiance-platform"
|
||||
assert row["endpoint_id"] == "tmux-amq-42-boot"
|
||||
|
||||
|
||||
def test_broker_rejects_legacy_injected_envelope_feedback(tmp_path):
|
||||
store = Store(tmp_path / "queue.sqlite3")
|
||||
message_id = store.add(
|
||||
"flex-auth",
|
||||
"audit-core",
|
||||
"Hello worker agent!",
|
||||
endpoint="tmux-amq-42-boot",
|
||||
)
|
||||
broker = InputBroker(
|
||||
store, BrokerIdentity("tmux-amq-42-boot", "audit-core")
|
||||
)
|
||||
|
||||
assert (
|
||||
broker.inspect_line(
|
||||
f"#flex-auth: Hello worker agent! [{message_id}]"
|
||||
)
|
||||
is None
|
||||
)
|
||||
assert len(store.list()) == 1
|
||||
|
||||
|
||||
def test_broker_does_not_block_unknown_receipt_like_user_text(tmp_path):
|
||||
store = Store(tmp_path / "queue.sqlite3")
|
||||
broker = InputBroker(
|
||||
store, BrokerIdentity("tmux-amq-42-boot", "audit-core")
|
||||
)
|
||||
|
||||
assert broker.inspect_line(
|
||||
"#flex-auth: Please inspect [m-00000000-0000-0000-0000-000000000000]"
|
||||
)
|
||||
assert len(store.list()) == 1
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from tamq.cli import (
|
|||
ensure_pushy_service,
|
||||
parse_size,
|
||||
)
|
||||
from tamq.service import PUSHY_FRAMING_CAPABILITY
|
||||
|
||||
|
||||
def test_parse_size():
|
||||
|
|
@ -51,8 +52,13 @@ def test_output_service_requires_terminal_output_capability(monkeypatch):
|
|||
|
||||
def test_pushy_service_requires_pushy_input_capability(monkeypatch):
|
||||
capabilities = iter([
|
||||
["manual_delivery", "terminal_output"],
|
||||
["manual_delivery", "terminal_output", "pushy_input"],
|
||||
[
|
||||
"manual_delivery",
|
||||
"terminal_output",
|
||||
"pushy_input",
|
||||
PUSHY_FRAMING_CAPABILITY,
|
||||
],
|
||||
])
|
||||
starts = []
|
||||
stops = []
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import asyncio
|
||||
import json
|
||||
|
||||
from tamq.service import Service
|
||||
from tamq.service import PUSHY_FRAMING_CAPABILITY, Service
|
||||
from tamq.store import Store
|
||||
|
||||
|
||||
|
|
@ -19,3 +19,24 @@ def test_incompatible_protocol_rejected(tmp_path):
|
|||
finally:
|
||||
server.close(); await server.wait_closed(); service.close()
|
||||
asyncio.run(run())
|
||||
|
||||
|
||||
def test_ping_advertises_non_routable_pushy_framing(tmp_path):
|
||||
async def run():
|
||||
path = tmp_path / "tamq.sock"
|
||||
service = Service(path, Store(tmp_path / "queue.sqlite3"))
|
||||
server = await asyncio.start_unix_server(service.handle, path=str(path))
|
||||
try:
|
||||
reader, writer = await asyncio.open_unix_connection(str(path))
|
||||
writer.write(b'{"op":"ping"}\n')
|
||||
await writer.drain()
|
||||
response = json.loads(await reader.readline())
|
||||
assert PUSHY_FRAMING_CAPABILITY in response["capabilities"]
|
||||
writer.close()
|
||||
await writer.wait_closed()
|
||||
finally:
|
||||
server.close()
|
||||
await server.wait_closed()
|
||||
service.close()
|
||||
|
||||
asyncio.run(run())
|
||||
|
|
|
|||
|
|
@ -369,6 +369,23 @@ def test_real_tmux_hash_route_pushes_once_without_feedback(tmp_path, monkeypatch
|
|||
assert f"AGENT:{expected}" in target_capture
|
||||
assert store.list()[0]["state"] == "injected"
|
||||
|
||||
legacy_envelope = (
|
||||
f"#railiance-platform: Hello! [{row['message_id']}]"
|
||||
)
|
||||
manager._run(
|
||||
"send-keys",
|
||||
"-t",
|
||||
f"{session}:activity-core",
|
||||
"-l",
|
||||
"--",
|
||||
legacy_envelope,
|
||||
)
|
||||
manager._run(
|
||||
"send-keys", "-t", f"{session}:activity-core", "Enter"
|
||||
)
|
||||
time.sleep(0.1)
|
||||
assert len(store.list()) == 1
|
||||
|
||||
service._deliver_once()
|
||||
time.sleep(0.1)
|
||||
assert len(store.list()) == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue