#21657: feat(session_status): expose fallback metadata in tool details
agents
size: S
Cluster:
Model Fallbacks and Rate Limiting
## Summary\n- expose fallback metadata fields in tool payload\n- include , , , \n- add e2e assertions for no-fallback default and active fallback scenarios\n\n## Why\nUsers need machine-readable fallback visibility after model failover to know which model actually handled the run.\n\n## Testing\n- corepack pnpm test:e2e src/agents/openclaw-tools.session-status.e2e.test.ts\n
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Exposes fallback metadata fields (`fallbackActive`, `fallbackSelectedModel`, `fallbackActiveModel`, `fallbackReason`) in the `session_status` tool's `details` payload. This provides machine-readable visibility into model failover events, allowing users to programmatically determine which model actually processed a request after fallback. The implementation correctly extracts these fields from the session entry and includes comprehensive e2e test coverage for both no-fallback and active-fallback scenarios.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation is straightforward and follows existing patterns. It only exposes existing session entry fields without modifying any business logic. The PR includes comprehensive e2e test coverage for both scenarios (no fallback and active fallback), and the changes are minimal and well-contained.
- No files require special attention
<sub>Last reviewed commit: 92f04df</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#23738: feat(fallback): first-class transition visibility + low-noise autom...
by SmithLabsLLC · 2026-02-22
77.1%
#23318: feat(agents): emit model:fallback hook event for fallback visibilit...
by anillBhoi · 2026-02-22
77.1%
#8390: feat: notify user when fallback model is used (#8182)
by Glucksberg · 2026-02-04
75.5%
#19252: fix(agents): continue model fallback on failover text payloads
by mahsumaktas · 2026-02-17
74.8%
#15726: fix(sessions): use model contextWindow instead of agent contextToke...
by lailoo · 2026-02-13
74.1%
#15815: Fallback LLM doesn't trigger if primary model is local
by shihanqu · 2026-02-13
73.5%
#9511: feat: add tool error fallback toggle
by bolismauro · 2026-02-05
72.6%
#23816: fix(agents): model fallback skipped during session overrides and pr...
by ramezgaberiel · 2026-02-22
72.6%
#11693: Model Provider Failover for Default and Session Model When Rate Lim...
by synchronic1 · 2026-02-08
72.4%
#13658: fix: silent model failover with fallback notification
by taw0002 · 2026-02-10
71.5%