hermes-agent/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: provider modules — ProviderProfile ABC, 33 providers, fetch_models, transport single-path 2026-05-05 13:40:01 -07:00
anthropic.py fix(agent): surface model refusals instead of retrying them as errors 2026-06-14 12:10:08 +05:30
base.py feat: add transport ABC + AnthropicTransport wired to all paths 2026-04-21 01:27:01 -07:00
bedrock.py feat: add BedrockTransport + wire all Bedrock transport paths 2026-04-21 20:58:37 -07:00
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
codex.py fix(codex): drop extra_headers for chatgpt.com backend 2026-06-13 07:13:24 -07:00
codex_app_server.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
codex_app_server_session.py fix(codex): record app-server token usage in session accounting 2026-06-09 02:46:04 -07:00
codex_event_projector.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
hermes_tools_mcp_server.py docs(hermes_tools_mcp_server): align scope docstring with EXPOSED_TOOLS (#26603) 2026-05-15 14:44:27 -07:00
types.py fix(anthropic): preserve interleaved thinking/tool_use block order on replay 2026-06-10 20:45:16 -07:00