Skip to content

Fail fast on credential refresh, add git fetch timeouts#56

Merged
jonathonbyrdziak merged 1 commit intomasterfrom
fix/credential-refresh-failsafe
Mar 21, 2026
Merged

Fail fast on credential refresh, add git fetch timeouts#56
jonathonbyrdziak merged 1 commit intomasterfrom
fix/credential-refresh-failsafe

Conversation

@jonathonbyrdziak
Copy link
Copy Markdown
Contributor

Summary

  • ProtocolStart Stage 2 now throws a RuntimeException if GitHub App credential refresh fails, instead of silently proceeding with expired tokens that cause git fetch to hang
  • GitHubApp::getAccessToken() logs the specific failure reason (missing PEM, JWT failure, no installation found, etc.) to the protocol log
  • All git fetch commands wrapped with timeout 30 to prevent indefinite hangs
  • StageRunner log directory uses sudo mkdir -p /var/log/protocol/ with fallback to NODE_DATA_DIR

Test plan

  • Run protocol start with valid GitHub App credentials — verify "Credentials refreshed successfully" in log
  • Run protocol start with invalid/expired PEM — verify Stage 2 fails immediately with clear error
  • Verify logs appear in /var/log/protocol/protocol-start.log
  • Verify git fetch times out after 30s instead of hanging indefinitely

🤖 Generated with Claude Code

- ProtocolStart Stage 2 now throws RuntimeException if credential refresh
  fails instead of silently proceeding with expired tokens
- GitHubApp::getAccessToken() logs specific failure reason to protocol log
- git fetch commands wrapped with `timeout 30` to prevent indefinite hangs
- StageRunner uses `sudo mkdir` for /var/log/protocol/ with NODE_DATA_DIR fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jonathonbyrdziak jonathonbyrdziak merged commit 1935706 into master Mar 21, 2026
6 of 8 checks passed
@jonathonbyrdziak jonathonbyrdziak deleted the fix/credential-refresh-failsafe branch March 21, 2026 01: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