fix: resolve portal startup hangs with non-blocking init (#93)

* fix: resolve portal startup hangs with non-blocking init

- Add socket_connect_timeout/socket_timeout (3s) to Redis connection in
  SwarmComms to prevent infinite hangs when Redis is unreachable
- Defer reconcile_on_startup() from SwarmCoordinator.__init__() to an
  explicit initialize() call during app lifespan, unblocking the
  module-level singleton creation
- Make Ollama health checks non-blocking via asyncio.to_thread() so they
  don't freeze the event loop for 2s per call
- Fix _check_redis() to reuse coordinator's SwarmComms singleton instead
  of creating a new connection on every health check
- Move discord bot platform registration from lifespan critical path
  into background task to avoid heavy import before yield
- Increase Docker healthcheck start_period from 10s/15s to 30s to give
  the app adequate time to complete startup

https://claude.ai/code/session_016t5jNBYsUAQuyoR7sXe7Ux

* fix: disable commit signing in git_tools test fixture

The git_repo fixture inherits global gpgsign config, causing git_commit
to fail when the signing server rejects unsigned source context.
Disable signing in the temp repo's local config.

https://claude.ai/code/session_016t5jNBYsUAQuyoR7sXe7Ux

* fix: add dev extras for pip-based CI install

The CI workflow runs `pip install -e ".[dev]"` but after the Poetry
migration there was no `dev` extra defined — only a Poetry dev group.
This caused pytest to not be installed, resulting in exit code 127
(command not found) on every CI run.

Add a pip-compatible `dev` extra that mirrors the Poetry dev group
so both `pip install -e ".[dev]"` and `poetry install` work.

https://claude.ai/code/session_016t5jNBYsUAQuyoR7sXe7Ux

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Alexander Whitestone
2026-02-28 15:01:48 -05:00
committed by GitHub
parent ca0c42398b
commit 1e19164379
9 changed files with 62 additions and 22 deletions

View File

@@ -28,11 +28,12 @@ def git_repo(tmp_path):
result = git_init(tmp_path)
assert result["success"]
# Configure git identity for commits
# Configure git identity and disable signing for commits
from git import Repo
repo = Repo(str(tmp_path))
repo.config_writer().set_value("user", "name", "Test").release()
repo.config_writer().set_value("user", "email", "test@test.com").release()
repo.config_writer().set_value("commit", "gpgsign", "false").release()
# Create initial commit
readme = tmp_path / "README.md"