fix(compression): notify users when configured aux model fails even if main-model fallback recovers - #16775
Merged
Merged
Conversation
…f main-model fallback recovers A misconfigured auxiliary.compression.model is a user-fixable problem that silent recovery would hide. The previous retry-on-main logic transparently swallowed aux-model failures whenever the fallback succeeded, leaving the user's broken config in place and racking up future failures. Track the aux-model failure on the compressor alongside the existing fallback-placeholder fields: - _last_aux_model_failure_model: str | None - _last_aux_model_failure_error: str | None Both are set at the moment the aux model errors (captured before summary_model is cleared for retry), regardless of whether the retry succeeds. Cleared at compress() start and on on_session_reset() so a clean run doesn't leak stale warnings. Surface at three places: - gateway hygiene auto-compress: ℹ note to the platform adapter (thread_id preserved) - gateway /compress command: ℹ line appended to the reply - CLI via _emit_warning: deduped on (model, error) so repeat compactions don't spam Distinct from the existing⚠️ dropped-turns warning — different severity, different emoji, explicit 'context is intact' reassurance.
cluricaun28
referenced
this pull request
in cluricaun28/Logos
Apr 28, 2026
…f main-model fallback recovers (#16775) A misconfigured auxiliary.compression.model is a user-fixable problem that silent recovery would hide. The previous retry-on-main logic transparently swallowed aux-model failures whenever the fallback succeeded, leaving the user's broken config in place and racking up future failures. Track the aux-model failure on the compressor alongside the existing fallback-placeholder fields: - _last_aux_model_failure_model: str | None - _last_aux_model_failure_error: str | None Both are set at the moment the aux model errors (captured before summary_model is cleared for retry), regardless of whether the retry succeeds. Cleared at compress() start and on on_session_reset() so a clean run doesn't leak stale warnings. Surface at three places: - gateway hygiene auto-compress: ℹ note to the platform adapter (thread_id preserved) - gateway /compress command: ℹ line appended to the reply - CLI via _emit_warning: deduped on (model, error) so repeat compactions don't spam Distinct from the existing⚠️ dropped-turns warning — different severity, different emoji, explicit 'context is intact' reassurance.
donald131
pushed a commit
to donald131/hermes-agent
that referenced
this pull request
May 2, 2026
…f main-model fallback recovers (NousResearch#16775) A misconfigured auxiliary.compression.model is a user-fixable problem that silent recovery would hide. The previous retry-on-main logic transparently swallowed aux-model failures whenever the fallback succeeded, leaving the user's broken config in place and racking up future failures. Track the aux-model failure on the compressor alongside the existing fallback-placeholder fields: - _last_aux_model_failure_model: str | None - _last_aux_model_failure_error: str | None Both are set at the moment the aux model errors (captured before summary_model is cleared for retry), regardless of whether the retry succeeds. Cleared at compress() start and on on_session_reset() so a clean run doesn't leak stale warnings. Surface at three places: - gateway hygiene auto-compress: ℹ note to the platform adapter (thread_id preserved) - gateway /compress command: ℹ line appended to the reply - CLI via _emit_warning: deduped on (model, error) so repeat compactions don't spam Distinct from the existing⚠️ dropped-turns warning — different severity, different emoji, explicit 'context is intact' reassurance.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…f main-model fallback recovers (NousResearch#16775) A misconfigured auxiliary.compression.model is a user-fixable problem that silent recovery would hide. The previous retry-on-main logic transparently swallowed aux-model failures whenever the fallback succeeded, leaving the user's broken config in place and racking up future failures. Track the aux-model failure on the compressor alongside the existing fallback-placeholder fields: - _last_aux_model_failure_model: str | None - _last_aux_model_failure_error: str | None Both are set at the moment the aux model errors (captured before summary_model is cleared for retry), regardless of whether the retry succeeds. Cleared at compress() start and on on_session_reset() so a clean run doesn't leak stale warnings. Surface at three places: - gateway hygiene auto-compress: ℹ note to the platform adapter (thread_id preserved) - gateway /compress command: ℹ line appended to the reply - CLI via _emit_warning: deduped on (model, error) so repeat compactions don't spam Distinct from the existing⚠️ dropped-turns warning — different severity, different emoji, explicit 'context is intact' reassurance.
dannyJ848
pushed a commit
to dannyJ848/hermes-agent
that referenced
this pull request
May 17, 2026
…f main-model fallback recovers (NousResearch#16775) A misconfigured auxiliary.compression.model is a user-fixable problem that silent recovery would hide. The previous retry-on-main logic transparently swallowed aux-model failures whenever the fallback succeeded, leaving the user's broken config in place and racking up future failures. Track the aux-model failure on the compressor alongside the existing fallback-placeholder fields: - _last_aux_model_failure_model: str | None - _last_aux_model_failure_error: str | None Both are set at the moment the aux model errors (captured before summary_model is cleared for retry), regardless of whether the retry succeeds. Cleared at compress() start and on on_session_reset() so a clean run doesn't leak stale warnings. Surface at three places: - gateway hygiene auto-compress: ℹ note to the platform adapter (thread_id preserved) - gateway /compress command: ℹ line appended to the reply - CLI via _emit_warning: deduped on (model, error) so repeat compactions don't spam Distinct from the existing⚠️ dropped-turns warning — different severity, different emoji, explicit 'context is intact' reassurance.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…f main-model fallback recovers (NousResearch#16775) A misconfigured auxiliary.compression.model is a user-fixable problem that silent recovery would hide. The previous retry-on-main logic transparently swallowed aux-model failures whenever the fallback succeeded, leaving the user's broken config in place and racking up future failures. Track the aux-model failure on the compressor alongside the existing fallback-placeholder fields: - _last_aux_model_failure_model: str | None - _last_aux_model_failure_error: str | None Both are set at the moment the aux model errors (captured before summary_model is cleared for retry), regardless of whether the retry succeeds. Cleared at compress() start and on on_session_reset() so a clean run doesn't leak stale warnings. Surface at three places: - gateway hygiene auto-compress: ℹ note to the platform adapter (thread_id preserved) - gateway /compress command: ℹ line appended to the reply - CLI via _emit_warning: deduped on (model, error) so repeat compactions don't spam Distinct from the existing⚠️ dropped-turns warning — different severity, different emoji, explicit 'context is intact' reassurance.
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…f main-model fallback recovers (NousResearch#16775) A misconfigured auxiliary.compression.model is a user-fixable problem that silent recovery would hide. The previous retry-on-main logic transparently swallowed aux-model failures whenever the fallback succeeded, leaving the user's broken config in place and racking up future failures. Track the aux-model failure on the compressor alongside the existing fallback-placeholder fields: - _last_aux_model_failure_model: str | None - _last_aux_model_failure_error: str | None Both are set at the moment the aux model errors (captured before summary_model is cleared for retry), regardless of whether the retry succeeds. Cleared at compress() start and on on_session_reset() so a clean run doesn't leak stale warnings. Surface at three places: - gateway hygiene auto-compress: ℹ note to the platform adapter (thread_id preserved) - gateway /compress command: ℹ line appended to the reply - CLI via _emit_warning: deduped on (model, error) so repeat compactions don't spam Distinct from the existing⚠️ dropped-turns warning — different severity, different emoji, explicit 'context is intact' reassurance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a user's configured
auxiliary.compression.modelerrors out but compression recovers by retrying on the main model, we now still tell the user their aux model is broken. Before: silent recovery hid a misconfig only they could fix.Distinct from the existing⚠️ dropped-turns warning — this is an ℹ note confirming context is intact while flagging the config problem.
Changes
agent/context_compressor.py_last_aux_model_failure_model+_last_aux_model_failure_erroron the compressor. Set in both retry-on-main branches (the 404/503 fast-path and the unknown-error best-effort path from fix(compression): retry summary on main model for unknown errors before giving up #16774), beforesummary_modelis cleared. Cleared atcompress()start +on_session_reset()so warnings don't leak across runs.gateway/run.pyℹ️ Configured compression model '<model>' failed (<err>). Recovered using your main model — context is intact — but you may want to check auxiliary.compression.model in config.yaml.via the platform adapter withthread_idmetadata preserved./compresscommand: same elif pattern, ℹ line appended to the reply.run_agent.py_compress_context: after the existing_last_summary_errorwarning emit, anelsebranch emits the aux-failure notice via_emit_warningfor CLI users. Deduped on(model, error)via_last_aux_fallback_warning_keyso repeat compactions don't spam.Validation
4 new tests:
_last_aux_model_failure_*is populated.TestAuxModelFallbackSurfacedToCallers: compress()-level exposure + clear-on-next-call.test_compress_command_surfaces_aux_model_failure_even_when_recovered: /compress ℹ line + "context is intact".test_session_hygiene_informs_user_when_aux_model_fails_but_recovers: hygiene-path ℹ note lands in the right thread.Followup to #16774 (retry-on-main) and #16771 (original gateway warning plumbing).