Skip to content

Bound startup retry loop and add SKIP_STARTUP_CHECKS env flag#10

Draft
Copilot wants to merge 2 commits intohawki_improvementsfrom
copilot/sub-pr-9
Draft

Bound startup retry loop and add SKIP_STARTUP_CHECKS env flag#10
Copilot wants to merge 2 commits intohawki_improvementsfrom
copilot/sub-pr-9

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 12, 2026

run_startup_checks() contained an unbounded while retry loop — if Hawki was unreachable or ALLOWED_KEYS was misconfigured, the app would hang indefinitely, blocking TestClient-based tests and production startup alike.

Changes

  • SKIP_STARTUP_CHECKS (default: false): Bypasses all startup checks when true. Background cleanup task is still scheduled. Intended for test/dev environments.
  • STARTUP_MAX_RETRIES (default: 0 = unlimited): Caps the Hawki endpoint retry loop. On exhaustion, logs an error and returns — service continues in degraded state rather than blocking forever.
  • Invalid STARTUP_MAX_RETRIES value raises a ValueError with a descriptive message at startup.
# .env or environment
SKIP_STARTUP_CHECKS=true        # skip entirely in tests
STARTUP_MAX_RETRIES=5           # give up after 5 attempts in prod

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: dschiese <135758800+dschiese@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on Hawki improvements pull request Bound startup retry loop and add SKIP_STARTUP_CHECKS env flag Mar 12, 2026
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.

2 participants