Reuse an eligible housekeeping reply before output transforms, persistence
and receipt generation when the local host requires a reply. Keep permitted
silence and marker-only warnings unchanged.
Reconcile recovered stream finals with their own delivered segment,
including transformed text and split previews. Treat short recovered
answers as successful replies and sanitize them before persistence.
Cover local gateway composition, output hooks, recovery, receipt identity,
stream transports and the unchanged silence controls.
The hidden-row step covered only the tool-call row of run_tool_round.
Other assistant rows a held turn appends and flushes without showing them
were stored displayable, so reopening the session (TUI/Desktop
display_projection, dashboard, classic CLI resume) showed the original text
even when the final was rewritten:
- the attempted answer a late LSP verdict, verify-on-stop or pre_verify
sends back (_append_interim_answer), and the kanban stop-guard answer;
- length-continuation fragments of a reply that then recovered (the final
row holds the rewrite of the whole, so the raw pieces also duplicated it);
- the intent-ack / stall / degenerate-final continuation rows, codex
status=incomplete partials, and commentary on a call to an unknown tool
or with broken JSON arguments (turn_tool_validation).
Every one of them is built by AIAgent._build_assistant_message, so the
hiding now happens there: in a held turn a row with visible text comes
back typed display_kind="hidden" (withhold_held_row) before anything can
flush it, and finish_text_response publishes the one row the user gets
(publish_held_final_row: visible again and, after recovered fragments,
carrying the whole reply; api_content keeps the piece the model wrote, so
the wire is unchanged). display_kind never reaches the wire, so the
model's context and cached prefix stay byte-for-byte (the test replays the
resumed session and compares the request).
Same class, also fixed: text beside a housekeeping call reused as the
reply after an empty follow-up was flagged response_previewed/reused,
though a held turn never showed it; the classic CLI then printed nothing.
Tests (tests/agent/test_hold_stream_exits.py, red on 3a5b54d980): late
LSP verdict, recovered continuation, unknown-tool commentary, reused
commentary.
Review: https://github.com/NousResearch/hermes-agent/pull/144266#discussion_r4370678628
A clean-stop response with empty content and a reasoning payload was
promoted to the visible answer on every route. A field name is not
provenance: OpenRouter, DeepSeek and other adapters put private
chain-of-thought in `reasoning`, so users saw the model's private
thoughts as the reply (#111761, #114082). Exhausted recovery also echoed
a 500-char reasoning preview.
Promotion now requires a trusted route: an explicit
`answer_in_reasoning` runtime capability, a custom_providers per-model
opt-in, or the local Nemotron-3.5-Lightning parser route from #109205.
The decision lives in runtime_capabilities and is re-derived at startup,
fallback activation, primary restore and model switch. Exhausted
recovery returns the empty sentinel without a reasoning preview.
Rebuilt by hand on current main (keeps the Anthropic signed-thinking
skip and the _refund_api_call import added since the PR's base).
Salvaged from #112833 (a339569d77, 15a19b2fc0, 1d240e7b24).
When the model answers beside a housekeeping tool call (memory, todo_list,
skill_manage, session_search) and the follow-up is empty, the turn ends on
that pre-tool answer (fallback_prior_turn_content, since #10472). The final
then repeats text the client already streamed before the tool, but nothing on
the wire says so: message.complete looks like a new response.
Record the reuse where it happens (the housekeeping fallback and the
budget-exhaustion reuse of a previewed verification candidate), report
response_reused only when the final still equals that text (a footer or
explanation appended later drops it), and carry it on message.complete.
Never inferred from equal text: "Done." / tool / "Done." are two responses.
turn_context_compaction imports neither conversation_loop nor
turn_empty_response, so the function-local import is not guarding a
cycle. The helper's docstring now also covers the provider-switch
fallback hop that reached the provider.
Fallback activation after empty-response retries re-entered the outer loop
without refunding the provisional call, so a provider hop consumed an
iteration. Refund via _refund_api_call and carry the count back through
EmptyResponseVerdict -> FinalResponseVerdict -> s.api_call_count.
Salvaged from #88867.
Co-authored-by: RelaxJonh <92573950+RelaxJonh@users.noreply.github.com>
Squash of the 54 commits on victor-kyriazakos:feat/user-channel-warning-suppression
(PR #112302, head f45c640e55) so the contributor's authorship survives a rebase-merge;
the commits interleave with a cron delivery-ledger rework that the salvage removes in
follow-up commits, so per-commit cherry-picks were not practical.
Adds display.suppress_warning_notifications (global + per-platform, default false):
one resolver (gateway/warning_notifications.py), BasePlatformAdapter.emit_warning /
emit_media_warning / warning_text, a notification_category classification carried
through wakes, queues and persistence, and render/present boundaries for CLI/TUI.
Squashed integration of the user-facing message audit for this surface set.
Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).