hermes-agent/tests/agent/transports
kshitijk4poor 12c84d6c77 fix(transports): only treat a refusal as terminal when it is the sole payload
A chat-completions response that carries real text or tool calls *alongside*
a `message.refusal` note is a normal, usable turn — the model did work. The
prior logic flipped finish_reason to `content_filter` whenever a refusal
string was present, so the conversation loop reframed a content-bearing turn
as a *failed* safety refusal (failed=True) and buried the model's actual
output inside the "model declined" template, or dropped tool calls entirely.

Only promote to a terminal `content_filter` when the refusal is the sole
payload (no visible text AND no tool calls). The refusal explanation is still
recorded in provider_data in every case for observability. Refusal-only
responses (the bug this feature targets) are unaffected and still surface
terminally; the empty+refusal, bare content_filter passthrough, and no-refusal
common cases are byte-identical to before.

Updates the partial-content test to the corrected contract and adds a
tool_calls-alongside-refusal regression guard.
2026-06-14 12:12:52 +05:30
..
__init__.py feat: add transport types + migrate Anthropic normalize path 2026-04-20 23:06:00 -07:00
test_bedrock_transport.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_chat_completions.py fix(transports): only treat a refusal as terminal when it is the sole payload 2026-06-14 12:12:52 +05:30
test_codex_app_server_runtime.py fix(codex): allow kanban worker board writes 2026-05-17 11:50:43 -07:00
test_codex_app_server_session.py fix(codex): record app-server token usage in session accounting 2026-06-09 02:46:04 -07:00
test_codex_event_projector.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_codex_transport.py fix(codex): drop extra_headers for chatgpt.com backend 2026-06-13 07:13:24 -07:00
test_hermes_tools_mcp_server.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_transport.py fix(agent): surface model refusals instead of retrying them as errors 2026-06-14 12:10:08 +05:30
test_types.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00