hermes-agent/agent
helix4u 056a40aa4d fix(agent): defer turns during compression lock contention instead of exhausting
A lock-loser compression pass returns its input unchanged, which the
automatic compression sites misread as 'cannot compress further': the
preflight loop armed the insufficient-progress blocker, the pre-API gate
burned a shared attempt, and a lock-contended 413/overflow retried into
the attempt cap and returned compression_exhausted — which the gateway
answers with a full session auto-reset (#9893/#35809). A temporary
concurrent-compression defer wiped the session.

Consume the landed #69870 lock-skip signal on every automatic path
(preflight in turn_context, pre-API pressure gate, 413 handler, overflow
handler, post-tool compaction): when a pass no-ops AND the type-pinned
lock-skip flag is set, refund the attempt (never count it toward the cap
or the insufficient-progress blocker), and when the turn cannot proceed
(provider already proved the request does not fit) end it with a soft
compression_deferred result — distinct from compression_exhausted — so
the gateway keeps the session intact and the next message retries after
the concurrent compressor finishes.

The new compression_skipped_due_to_lock() reader is type-pinned
(is True or isinstance(str)) per the MagicMock auto-attribute rule, and
compress_context() now also clears the signal at the very top of every
attempt (per-attempt state rule, #58629/#69853) so a stale value can
never make a later breaker/codex no-op look like lock contention.

Salvaged from PR #49874; rebuilt on main's #69870
_compression_skipped_due_to_lock signal instead of the PR's parallel
_compression_deferred_by_lock triple.
2026-07-23 16:23:57 -07:00
..
lsp refactor(lsp): version-tagged _DocState replaces timestamp freshness tracking 2026-07-20 13:43:36 -04:00
pet
…
secret_sources fix(secrets): harden encrypted Bitwarden cache 2026-07-22 04:40:07 -07:00
transports fix(windows): hide console flashes in GUI-reachable exec paths and provider transports (#56747) 2026-07-23 07:33:28 -07:00
__init__.py
…
account_usage.py fix(auth): detect upstream Codex quota resets and lift stale pool cooldowns (#69494) 2026-07-22 10:58:22 -07:00
agent_init.py fix: preserve named custom provider vision overrides 2026-07-23 17:57:33 +05:30
agent_runtime_helpers.py fix(credential-pool): refresh the failing entry, not current(), on auth recovery 2026-07-23 07:33:25 -07:00
anthropic_adapter.py fix(anthropic): coerce empty/whitespace-only text blocks on the request path (#69512) (#69517) 2026-07-23 16:36:37 -04:00
async_utils.py refactor(gateway): dedupe detached-task consumer + reconnect backoff policy 2026-07-18 20:01:55 +05:30
aux_accounting.py
…
auxiliary_client.py fix: forward max_tokens to gemini-native so MoA reference cap applies 2026-07-23 16:17:27 -07:00
azure_identity_adapter.py
…
background_review.py
…
battery.py feat(status-bar): add /battery toggle for a color-coded battery read-out 2026-07-21 13:54:11 -05:00
bedrock_adapter.py feat(bedrock): add Converse API prompt caching (cachePoint) 2026-07-23 11:45:07 -07:00
billing_links.py feat(billing): shared cross-surface out-of-credits signal 2026-07-22 18:08:59 -05:00
billing_usage.py feat(tui+cli): change your Nous plan from the terminal (/subscription, /topup, terminal-billing UX) (#51639) 2026-07-18 14:30:24 +05:30
billing_view.py fix(billing): rename user-facing "terminal billing" copy to Remote Spending (#68355) 2026-07-21 12:20:25 +05:30
bounded_response.py
…
browser_provider.py
…
browser_registry.py
…
chat_completion_helpers.py fix: preserve named custom provider vision overrides 2026-07-23 17:57:33 +05:30
codex_responses_adapter.py
…
codex_runtime.py feat(codex): honor redirect and hard stop in the app-server runtime 2026-07-22 12:02:40 -05:00
coding_context.py fix(windows): share one bounded, tree-killing git probe across both call sites (#68997) 2026-07-21 20:18:43 -05:00
context_breakdown.py
…
context_compressor.py Surface warning when context exceeds compression threshold but compression is blocked 2026-07-23 08:43:21 -07:00
context_engine.py fix(compression): reset blocked-overflow dedup on every compression path + noise-filter survival pins 2026-07-23 08:43:21 -07:00
context_references.py
…
conversation_compression.py fix(agent): defer turns during compression lock contention instead of exhausting 2026-07-23 16:23:57 -07:00
conversation_loop.py fix(agent): defer turns during compression lock contention instead of exhausting 2026-07-23 16:23:57 -07:00
copilot_acp_client.py fix(windows): hide console flashes in GUI-reachable exec paths and provider transports (#56747) 2026-07-23 07:33:28 -07:00
credential_persistence.py
…
credential_pool.py fix: resolve current entry unlocked in try_refresh_matching no-hint branch 2026-07-23 09:31:58 -07:00
credential_sources.py
…
credits_tracker.py feat(credits): report $used of $cap instead of % in the usage notice 2026-07-23 01:28:58 -05:00
curator.py
…
curator_backup.py fix(cron): widen UTF-8 BOM tolerance to backup/curator jobs.json readers 2026-07-18 02:31:20 -07:00
delegation_context.py fix(kanban): harden delegated-child mutation boundary 2026-07-23 07:33:36 -07:00
display.py feat(gateway): live per-tool status line on Slack 2026-07-18 12:28:59 -07:00
error_classifier.py fix(gateway): distinguish gateway auth 401 from provider API key errors 2026-07-23 11:54:47 -07:00
errors.py fix(moa): surface stale presets without retries 2026-07-17 13:49:12 -07:00
file_safety.py fix(secrets): harden encrypted Bitwarden cache 2026-07-22 04:40:07 -07:00
gemini_native_adapter.py
…
gemini_schema.py fix(gemini): prune required entries missing from properties in tool schemas 2026-07-17 04:54:06 -07:00
i18n.py rip out brew + pip/PyPI wheel support (#68217) 2026-07-22 16:51:01 -04:00
image_gen_provider.py
…
image_gen_registry.py
…
image_routing.py feat(image_routing): accept vision alias for custom provider models 2026-07-23 08:32:09 -07:00
insights.py
…
iteration_budget.py
…
jiter_preload.py
…
kanban_stop.py
…
learn_prompt.py
…
learning_graph.py
…
learning_graph_render.py
…
learning_mutations.py
…
lmstudio_reasoning.py
…
manual_compression_feedback.py fix(compress): classify unconfirmed lock-acquire failures and cover all manual-compress surfaces 2026-07-23 08:19:14 -07:00
markdown_tables.py
…
memory_manager.py fix(memory): drain queued writes on shutdown 2026-07-17 04:55:58 -07:00
memory_provider.py
…
message_content.py
…
message_sanitization.py
…
moa_loop.py feat(moa): per-reference-model max_tokens override 2026-07-23 16:17:27 -07:00
moa_trace.py
…
model_metadata.py fix(moa): preserve custom provider context metadata 2026-07-23 11:21:04 -07:00
models_dev.py
…
moonshot_schema.py fix(agent): inject empty required array on Moonshot object schemas 2026-07-20 11:05:52 -07:00
nous_rate_guard.py
…
onboarding.py feat(surfaces): route busy-input corrections through active-turn redirect 2026-07-22 12:10:58 -05:00
oneshot.py
…
plugin_llm.py
…
portal_tags.py
…
process_bootstrap.py
…
prompt_builder.py fix(prompt): scope api_server MEDIA: hint to actual interception behavior 2026-07-23 11:55:01 -07:00
prompt_caching.py
…
rate_limit_tracker.py
…
reactions.py
…
reasoning_timeouts.py feat(models): add Claude Sonnet 5 support 2026-07-20 02:25:44 -07:00
redact.py fix(redaction): normalize URL credential key aliases 2026-07-20 02:25:57 -07:00
replay_cleanup.py refactor: shared helpers for api_content sidecar pop/drop/extract 2026-07-19 08:25:35 +05:30
retry_utils.py
…
runtime_cwd.py
…
secret_scope.py fix(secrets): scope BWS-injected provider keys 2026-07-22 04:39:17 -07:00
shell_hooks.py
…
skill_bundles.py
…
skill_commands.py
…
skill_preprocessing.py
…
skill_utils.py fix(skills): strip UTF-8 BOM before parsing SKILL.md frontmatter 2026-07-17 04:52:02 -07:00
ssl_guard.py
…
ssl_verify.py
…
stream_diag.py
…
stream_single_writer.py fix(streaming): make the single-writer fence best-effort so a missing guard can't crash a turn (#66448) 2026-07-17 18:31:09 +00:00
subdirectory_hints.py
…
subscription_view.py feat(cli): plan catalog on Free + plan= deep link + top-up/auto-refill copy split (#68689) 2026-07-22 08:11:09 +05:30
system_prompt.py fix: replace hardcoded ~/.hermes with get_hermes_home() in system prompt (#66450) 2026-07-18 19:03:51 -04:00
think_scrubber.py
…
thinking_timeout_guidance.py
…
thread_scoped_output.py
…
title_generator.py fix(title): prevent stale background title generation from reloading unloaded Ollama models 2026-07-16 23:07:13 -07:00
tool_dispatch_helpers.py
…
tool_executor.py fix(checkpoints): honor gateway config and task cwd (#68195) 2026-07-20 13:04:12 -07:00
tool_guardrails.py fix(agent): tolerate lone UTF-16 surrogates in tool-guardrail hashing 2026-07-18 02:08:39 -07:00
tool_result_classification.py
…
trace_upload.py
…
trajectory.py
…
transcription_provider.py
…
transcription_registry.py
…
tts_provider.py
…
tts_registry.py
…
turn_context.py fix(agent): defer turns during compression lock contention instead of exhausting 2026-07-23 16:23:57 -07:00
turn_finalizer.py fix(desktop, ink): don't wipe messages before final message (#65919) 2026-07-20 11:42:29 -04:00
turn_retry_state.py feat(agent): add active-turn redirect core primitive 2026-07-22 12:02:40 -05:00
usage_pricing.py fix(pricing): strip apac./au. Bedrock region prefixes so cost isn't unknown 2026-07-20 05:38:45 -07:00
verification_evidence.py fix(state): refuse WAL on SQLite builds with the WAL-reset bug 2026-07-23 17:32:38 +05:30
verification_stop.py
…
verify_hooks.py
…
vertex_adapter.py
…
video_gen_provider.py
…
video_gen_registry.py
…
web_search_provider.py
…
web_search_registry.py
…