mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-21 10:22:18 +00:00
test(chat-completions): cover timestamp strip + add AUTHOR_MAP entry
Add a regression test for #47868 asserting convert_messages strips the internal per-message timestamp field, plus the identity-return path for timestamp-free message lists. Map x7peeps for the release attribution gate.
This commit is contained in:
parent
4467c22c8f
commit
0a2b712965
2 changed files with 26 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ ACP_REGISTRY_MANIFEST = REPO_ROOT / "acp_registry" / "agent.json"
|
|||
# Auto-extracted from noreply emails + manual overrides
|
||||
AUTHOR_MAP = {
|
||||
"w31rdm4ch1n3z@protonmail.com": "w31rdm4ch1nZ",
|
||||
"xtpeeps@gmail.com": "x7peeps",
|
||||
"rratmansky@gmail.com": "rratmansky",
|
||||
"lkz-de@users.noreply.github.com": "lkz-de",
|
||||
"charles@salesondemand.io": "salesondemandio",
|
||||
|
|
|
|||
|
|
@ -104,6 +104,31 @@ class TestChatCompletionsBasic:
|
|||
# Original list untouched (deepcopy-on-demand)
|
||||
assert msgs[2]["tool_name"] == "execute_code"
|
||||
|
||||
def test_convert_messages_strips_timestamp(self, transport):
|
||||
"""Internal per-message ``timestamp`` metadata (stamped by
|
||||
``_apply_persist_user_message_override`` to preserve platform event
|
||||
time without embedding it in content, and persisted to the SQLite
|
||||
store) is not part of the OpenAI Chat Completions schema. Strict
|
||||
providers like Mistral / Fireworks-backed endpoints reject it with
|
||||
HTTP 422 'Extra inputs are not permitted, field: messages[N].timestamp'.
|
||||
Regression test for #47868.
|
||||
"""
|
||||
msgs = [
|
||||
{"role": "user", "content": "hi", "timestamp": 1781976577.0},
|
||||
]
|
||||
result = transport.convert_messages(msgs)
|
||||
assert "timestamp" not in result[0]
|
||||
assert result[0]["content"] == "hi"
|
||||
assert result[0]["role"] == "user"
|
||||
# Original list untouched (deepcopy-on-demand)
|
||||
assert msgs[0]["timestamp"] == 1781976577.0
|
||||
|
||||
def test_convert_messages_no_copy_without_timestamp(self, transport):
|
||||
"""A timestamp-free message list needs no sanitize pass and is
|
||||
returned by identity (preserves the deepcopy-on-demand contract)."""
|
||||
msgs = [{"role": "user", "content": "hi"}]
|
||||
assert transport.convert_messages(msgs) is msgs
|
||||
|
||||
def test_convert_messages_strips_internal_scaffolding_markers(self, transport):
|
||||
"""Hermes-internal ``_``-prefixed markers must never reach the wire.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue