Skip to content

[codex] Add IB Gateway API health recovery - #7

Merged
Pigbibi merged 1 commit into
mainfrom
codex/ib-gateway-api-healthcheck
Apr 17, 2026
Merged

[codex] Add IB Gateway API health recovery#7
Pigbibi merged 1 commit into
mainfrom
codex/ib-gateway-api-healthcheck

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a real IB API handshake readiness check for the Gateway container, plus automated recovery so Cloud Run does not depend on TCP-only port health.

What changed

  • Replaced TCP-only readiness with an IB API v100+ handshake that waits for nextValidId or managedAccounts.
  • Added a systemd health watcher that restarts ib-gateway when the API handshake fails.
  • Added a daily Gateway restart timer to reduce long-running IB Gateway stuck states.
  • Wired the installer into both keepalive and full deploy workflow paths.
  • Added tests for handshake retry behavior, recovery script coverage, and workflow wiring.

Validation

  • bash tests/test_wait_for_ib_gateway_ready.sh
  • bash tests/test_gateway_recovery_scripts.sh
  • bash tests/test_workflow_shared_config.sh
  • bash tests/test_docker_compose_ports.sh
  • bash tests/test_install_2fa_bot_watcher.sh
  • bash -n scripts/wait_for_ib_gateway_ready.sh scripts/recover_ib_gateway_ready.sh scripts/restart_ib_gateway_daily.sh scripts/install_gateway_health_watcher.sh scripts/install_2fa_bot_watcher.sh

Operational note

I also installed the new watcher timers on the current Gateway VM and verified the live IB API handshake succeeds against the running container.

@Pigbibi
Pigbibi marked this pull request as ready for review April 17, 2026 16:15
@Pigbibi
Pigbibi merged commit 410c80f into main Apr 17, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/ib-gateway-api-healthcheck branch April 17, 2026 16:16
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