Fix sticky fallback persistence timing and harden TTL parsing#7542
Closed
dkfjtang wants to merge 3 commits into
Closed
Fix sticky fallback persistence timing and harden TTL parsing#7542dkfjtang wants to merge 3 commits into
dkfjtang wants to merge 3 commits into
Conversation
added 3 commits
April 11, 2026 02:07
- upgrade agent-browser from ^0.13.0 to ^0.25.3 - refresh root package-lock.json after npm install - refresh whatsapp-bridge package-lock.json via npm audit fix - clear npm audit findings for browser tools and whatsapp bridge
- agent/anthropic_adapter.py: update adapter logic - agent/auxiliary_client.py: update auxiliary client handling - agent/model_metadata.py: update model metadata - gateway/run.py: update gateway runtime logic - tests/*: update corresponding test coverage
- move sticky fallback persistence from activation-time to success-time - add _maybe_persist_sticky_fallback() guard for fallback-only persistence - fall back to 600s when sticky_fallback_ttl is invalid or non-positive - add tests for activation-vs-success persistence, expired sticky cleanup, fallback A fail / fallback B success restore, and TTL parsing fallback
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
This PR fixes the sticky fallback persistence semantics in Hermes and hardens TTL parsing.
What changed
_maybe_persist_sticky_fallback()so only successful fallback runtimes are persisted600seconds whensticky_fallback_ttlis invalid or non-positiveWhy
Previously, sticky state could be written as soon as a fallback was activated.
That was too early: activation does not guarantee success.
In failure chains, this could incorrectly pin a failed fallback as sticky for future turns.
Validation
Result: