Live E2E stand: the SK1 echo line is bounded on the final text and is one line

The plugin capped the message and then added the "echo: " prefix (up to
206 characters) and did not normalize line breaks, so "one bounded line,
at most 200 characters" was false and the test pinned the 206 (codex M3
finding). Line breaks now collapse to spaces and the cap applies to the
final prefixed text; the pins assert the cap on the final text and the
single-line shape.

Co-authored-by: Ouroboros <311266734+ouroboros-agent@users.noreply.github.com>
This commit is contained in:
Ouroboros 2026-09-05 10:06:36 +00:00
parent 0c9265e7fc
commit 6dddf31a09
2 changed files with 7 additions and 3 deletions

View file

@ -93,7 +93,8 @@ SK1_PLUGIN = (
" # One bounded line into the owner's own chat per explicit call, then the same\n"
" # text back to the caller. Loopback Host Service only; proxies from the\n"
" # environment are ignored so the request can never leave this host.\n"
" text = 'echo: ' + str(message)[:MAX_CHARS]\n"
" # ONE line: line breaks collapse to spaces; the cap applies to the FINAL text.\n"
" text = ('echo: ' + ' '.join(str(message).split()))[:MAX_CHARS]\n"
" base = os.environ.get('HOST_SERVICE_URL') or (\n"
" 'http://127.0.0.1:' + os.environ.get('OUROBOROS_HOST_SERVICE_PORT', '8767'))\n"
" request = urllib.request.Request(\n"

View file

@ -622,8 +622,11 @@ def test_sk1_plugin_relays_one_bounded_line_into_the_owner_chat(monkeypatch):
"text": scenarios.SK1_ECHO_EXPECTED, "chat_id": scenarios.SK1_OWNER_CHAT_ID,
"sender_label": scenarios.SK1_SKILL}}]
long = echo(None, message="x" * (scenarios.SK1_ECHO_MAX_CHARS + 50))
assert long == hits[-1]["body"]["text"] == "echo: " + "x" * scenarios.SK1_ECHO_MAX_CHARS
assert len(hits) == 2 # exactly one line per call, no retry
assert long == hits[-1]["body"]["text"] == ("echo: " + "x" * scenarios.SK1_ECHO_MAX_CHARS)[:scenarios.SK1_ECHO_MAX_CHARS]
assert len(long) == scenarios.SK1_ECHO_MAX_CHARS # the cap bounds the FINAL text, prefix included
multi = echo(None, message="first\r\nsecond\nthird")
assert multi == hits[-1]["body"]["text"] == "echo: first second third" # ONE line: breaks collapse
assert len(hits) == 3 # exactly one line per call, no retry
finally:
sink.shutdown()
refusing = _inject_sink(403, [])