Skip to content

Guard _send_oncall_summary against None trading_bot#57

Merged
IamJasonBian merged 1 commit intoIamJasonBian/render-prod-dry-run-v1from
fix/oncall-summary-null-trading-bot
May 8, 2026
Merged

Guard _send_oncall_summary against None trading_bot#57
IamJasonBian merged 1 commit intoIamJasonBian/render-prod-dry-run-v1from
fix/oncall-summary-null-trading-bot

Conversation

@IamJasonBian
Copy link
Copy Markdown
Owner

Summary

  • Fixes 'NoneType' object has no attribute 'get_pdt_status' printed every cycle on the Render headless worker (logs at srv-d70trd15pdvs739ic1dg).
  • In publish-only mode (commit 3948fb0), self.trading_bot is intentionally None when RH creds are absent, but _send_oncall_summary still called .get_pdt_status() on it.
  • The existing else: lines.append("PDT: unavailable") branch already handles None, so the fix is a single ternary guard.

Note on netlify

Netlify auth is fine — the blob upload before the crash returned 201 Created. The error in the logs was the unrelated downstream Slack-summary path.

Test plan

  • pytest -q — no new failures introduced (7 pre-existing failures on the base branch are unrelated and present without this change).
  • Verify on Render after merge that [oncall] Error sending Slack summary no longer appears and the Slack summary message arrives with PDT: unavailable.

In publish-only/headless Render deploys, trading_bot is None when RH
credentials are absent. _send_oncall_summary called .get_pdt_status()
unconditionally, raising AttributeError after every successful blob
upload. The existing 'PDT: unavailable' branch already handles None,
so the fix is a single ternary guard.
@IamJasonBian IamJasonBian merged commit 1d70131 into IamJasonBian/render-prod-dry-run-v1 May 8, 2026
3 checks passed
@IamJasonBian IamJasonBian deleted the fix/oncall-summary-null-trading-bot branch May 8, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant