hermes-agent/agent
Brooklyn Nicholson 2d286a6d00 fix(agent): close tool-call sequence on all interrupt aborts, not just finalize_turn
#48879 closed the tool-call sequence on interrupt inside finalize_turn so a
/stop after a tool no longer persists a `tool` tail that the next user message
turns into a `tool -> user` role-alternation violation (which strict providers
like Gemini/Claude react to by hallucinating a continuation and ignoring prior
context — what users see as "lost context after stop").

But the retry-wait, error-handling, and post-error retry-wait interrupt aborts
in conversation_loop return early and never reach finalize_turn, so they still
persisted and returned a raw `tool` tail. Interrupting during provider
backoff/rate-limiting (common under heavy work) hit exactly this path.

Extract the close into a shared close_interrupted_tool_sequence helper and apply
it at every interrupt abort (finalize_turn + the three early returns) so the
whole bug class is fixed, not just the one site.
2026-06-25 12:24:34 -05:00
..
lsp
…
pet feat(pets): quality-first OpenRouter model chain + stronger atlas gates + global pet-gen notifications 2026-06-24 23:11:21 -05:00
secret_sources
…
transports fix(cache): content-address prompt_cache_key so recurring cron jobs reuse the warm prefix (#52295) 2026-06-24 21:46:30 -07:00
__init__.py
…
account_usage.py
…
agent_init.py fix: handle named custom providers and Z.AI overload retries 2026-06-25 00:17:17 -07:00
agent_runtime_helpers.py refactor(memory): move write-mirror gating behind MemoryManager interface 2026-06-22 07:00:42 -07:00
anthropic_adapter.py fix(anthropic): use platform.claude.com for OAuth token exchange 2026-06-23 23:59:40 -07:00
async_utils.py
…
auxiliary_client.py fix Nous auth refresh for idle agents 2026-06-21 22:43:48 -07:00
azure_identity_adapter.py
…
background_review.py feat(background-review): aux-model selector for the self-improvement review (#49252) 2026-06-22 14:54:53 -07:00
bedrock_adapter.py
…
billing_view.py feat(billing): /billing terminal billing — interactive TUI + CLI client (#45449) 2026-06-19 01:53:32 +05:30
browser_provider.py
…
browser_registry.py
…
chat_completion_helpers.py fix(agent): keep system-prompt model identity in sync across provider failover 2026-06-20 10:46:01 -07:00
codex_responses_adapter.py
…
codex_runtime.py fix(codex): seed app-server sessions with configured cwd 2026-06-21 16:39:02 -07:00
coding_context.py feat(agent): expose coding-context project facts as structured data + project.facts RPC (#51259) 2026-06-23 08:00:01 +00:00
context_compressor.py fix(compression): abort (preserve context) on transient network summary failure (#29559, #25585) 2026-06-24 18:31:51 +05:30
context_engine.py
…
context_references.py
…
conversation_compression.py fix(agent): shrink anthropic-native image history 2026-06-22 18:23:21 -05:00
conversation_loop.py fix(agent): close tool-call sequence on all interrupt aborts, not just finalize_turn 2026-06-25 12:24:34 -05:00
copilot_acp_client.py
…
credential_persistence.py
…
credential_pool.py fix(auth): make load_pool() non-destructive for env-seeded credentials 2026-06-21 08:26:37 -07:00
credential_sources.py
…
credits_tracker.py
…
curator.py
…
curator_backup.py
…
display.py fix(ui): share compact tool previews across clients 2026-06-25 00:47:14 -05:00
error_classifier.py
…
errors.py
…
file_safety.py
…
gemini_native_adapter.py
…
gemini_schema.py
…
i18n.py
…
image_gen_provider.py feat(image-gen): add image-to-image / editing to image_generate (#48705) 2026-06-18 22:13:07 -07:00
image_gen_registry.py
…
image_routing.py
…
insights.py
…
iteration_budget.py
…
jiter_preload.py
…
learn_prompt.py fix(learn): teach /learn the full CONTRIBUTING.md skill standards (#52372) 2026-06-25 00:17:23 -07:00
lmstudio_reasoning.py
…
manual_compression_feedback.py
…
markdown_tables.py
…
memory_manager.py fix(agent): validate context/memory tool schemas before wrapping 2026-06-25 02:17:29 +05:30
memory_provider.py fix(backup): capture memory-provider state stored outside HERMES_HOME (#50325) 2026-06-21 12:03:46 -07:00
message_content.py fix(openviking): preserve structured sync attribution 2026-06-19 15:23:41 +08:00
message_sanitization.py fix(agent): close tool-call sequence on all interrupt aborts, not just finalize_turn 2026-06-25 12:24:34 -05:00
model_metadata.py
…
models_dev.py
…
moonshot_schema.py
…
nous_rate_guard.py
…
onboarding.py
…
oneshot.py feat(agent): one-shot LLM helper + llm.oneshot gateway RPC (#51261) 2026-06-23 08:01:50 +00:00
plugin_llm.py
…
portal_tags.py
…
process_bootstrap.py
…
prompt_builder.py fix(cron): tell the user TUI/CLI cron jobs are local-only at create time (#51683) 2026-06-23 23:27:48 -07:00
prompt_caching.py
…
rate_limit_tracker.py
…
redact.py fix(redact): mask all Authorization schemes and x-api-key style headers 2026-06-21 14:08:06 -07:00
retry_utils.py fix: handle named custom providers and Z.AI overload retries 2026-06-25 00:17:17 -07:00
runtime_cwd.py
…
secret_scope.py feat(gateway): multiplex phase 2 — fail-closed profile credential isolation (Workstream A) 2026-06-19 07:34:15 -07:00
shell_hooks.py docs: document per-event extra keys in shell-hook wire protocol 2026-06-20 23:23:47 -07:00
skill_bundles.py
…
skill_commands.py
…
skill_preprocessing.py
…
skill_utils.py refactor(kanban): fold worker/orchestrator skills into injected guidance (#50473) 2026-06-21 17:06:48 -07:00
ssl_guard.py
…
stream_diag.py
…
subdirectory_hints.py
…
system_prompt.py feat(computer_use): cross-platform cua-driver (macOS/Windows/Linux) 2026-06-22 06:42:30 -07:00
think_scrubber.py
…
title_generator.py feat(titles): support language-aware title generation (#45296) 2026-06-19 17:15:52 -07:00
tool_dispatch_helpers.py feat(agent): require verification before finishing edits 2026-06-24 23:02:48 -05:00
tool_executor.py fix(agent): handle concurrent tool submit shutdown 2026-06-24 02:56:56 +05:30
tool_guardrails.py
…
tool_result_classification.py
…
trajectory.py
…
transcription_provider.py
…
transcription_registry.py
…
tts_provider.py
…
tts_registry.py
…
turn_context.py feat(agent): require verification before finishing edits 2026-06-24 23:02:48 -05:00
turn_finalizer.py fix(agent): close tool-call sequence on all interrupt aborts, not just finalize_turn 2026-06-25 12:24:34 -05:00
turn_retry_state.py fix(agent): fail over to fallback provider on persistent auth failure (401/403) 2026-06-20 11:38:01 -07:00
usage_pricing.py fix(bedrock): price Claude prompt-cache tokens in /usage (#50307) 2026-06-21 11:48:43 -07:00
verification_evidence.py feat(agent): recognize focused ad-hoc verification scripts 2026-06-24 23:03:45 -05:00
verification_stop.py feat(agent): recognize focused ad-hoc verification scripts 2026-06-24 23:03:45 -05:00
video_gen_provider.py
…
video_gen_registry.py
…
web_search_provider.py
…
web_search_registry.py
…