fix(discord): show actual voter values in decision embed during fallback
Pass raw a/b decisions to notify_decision so gemini shows its real
value (⛔ limit) instead of groq's value when rate-limited.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
680a4fcc5f
commit
7a0eccbcef
@ -155,8 +155,10 @@ def run_tick(
|
|||||||
|
|
||||||
discord.notify_decision(
|
discord.notify_decision(
|
||||||
settings, symbol, result,
|
settings, symbol, result,
|
||||||
label_a=f"{voter_a.provider}",
|
label_a=voter_a.provider,
|
||||||
label_b=(voter_b.provider if voter_b else "-"),
|
label_b=(voter_b.provider if voter_b else "-"),
|
||||||
|
decision_a=a,
|
||||||
|
decision_b=b,
|
||||||
)
|
)
|
||||||
|
|
||||||
if result.action in ("BUY", "SELL") and not position:
|
if result.action in ("BUY", "SELL") and not position:
|
||||||
|
|||||||
@ -64,7 +64,7 @@ def notify_startup(settings: Settings) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def notify_decision(settings: Settings, symbol: str, ensemble, label_a: str, label_b: str) -> None:
|
def notify_decision(settings: Settings, symbol: str, ensemble, label_a: str, label_b: str, decision_a=None, decision_b=None) -> None:
|
||||||
"""Optional: jede Ensemble-Decision posten (kann spammig sein)."""
|
"""Optional: jede Ensemble-Decision posten (kann spammig sein)."""
|
||||||
if not _should(settings, "decision"):
|
if not _should(settings, "decision"):
|
||||||
return
|
return
|
||||||
@ -73,14 +73,18 @@ def notify_decision(settings: Settings, symbol: str, ensemble, label_a: str, lab
|
|||||||
else COLOR_RED if ensemble.action == "SELL"
|
else COLOR_RED if ensemble.action == "SELL"
|
||||||
else COLOR_GRAY
|
else COLOR_GRAY
|
||||||
)
|
)
|
||||||
|
va = decision_a or ensemble.voter_a
|
||||||
|
vb = decision_b or ensemble.voter_b
|
||||||
|
va_val = "⛔ limit" if va.reasoning == "rate_limit_exhausted" else f"{va.action} ({va.confidence:.2f})"
|
||||||
|
vb_val = f"{vb.action} ({vb.confidence:.2f})"
|
||||||
_post(
|
_post(
|
||||||
settings,
|
settings,
|
||||||
{
|
{
|
||||||
"title": f"🧠 Decision {symbol}: {ensemble.action}",
|
"title": f"🧠 Decision {symbol}: {ensemble.action}",
|
||||||
"color": color,
|
"color": color,
|
||||||
"fields": [
|
"fields": [
|
||||||
{"name": label_a, "value": f"{ensemble.voter_a.action} ({ensemble.voter_a.confidence:.2f})", "inline": True},
|
{"name": label_a, "value": va_val, "inline": True},
|
||||||
{"name": label_b, "value": f"{ensemble.voter_b.action} ({ensemble.voter_b.confidence:.2f})", "inline": True},
|
{"name": label_b, "value": vb_val, "inline": True},
|
||||||
{"name": "Rationale", "value": ensemble.rationale, "inline": False},
|
{"name": "Rationale", "value": ensemble.rationale, "inline": False},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user