Log node request processing so operators can see live activity in the console.

This commit is contained in:
Dobromir Popov
2026-07-07 18:12:57 +02:00
parent 1eb1e0baa2
commit aba5fb12fa
4 changed files with 65 additions and 6 deletions

View File

@@ -225,7 +225,7 @@ def test_tail_forward_returns_text_completion_from_binary_activations():
node.stop()
def test_full_model_chat_completion_uses_generation_not_single_token_decode():
def test_full_model_chat_completion_uses_generation_not_single_token_decode(capsys):
node = TorchNodeServer(backend=_FakeFullBackend())
port = node.start()
try:
@@ -237,7 +237,10 @@ def test_full_model_chat_completion_uses_generation_not_single_token_decode():
req = urllib.request.Request(
f"http://127.0.0.1:{port}/v1/chat/completions",
data=payload,
headers={"Content-Type": "application/json"},
headers={
"Content-Type": "application/json",
"X-Meshnet-Request-Id": "req-test-123",
},
method="POST",
)
with urllib.request.urlopen(req, timeout=5) as resp:
@@ -248,6 +251,10 @@ def test_full_model_chat_completion_uses_generation_not_single_token_decode():
finally:
node.stop()
out = capsys.readouterr().out
assert " [node] processing chat model='fake-model' stream=False max_tokens=7 request_id=req-test-123" in out
assert " [node] chat complete tokens=1 elapsed_s=" in out
def test_pipeline_hop_logs_are_suppressed_without_debug(capsys):
tail_backend = _FakePipelineTailBackend()