-
Notifications
You must be signed in to change notification settings - Fork 129
fix(pegboard): fix tunnel ack from gateway #3326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(pegboard): fix tunnel ack from gateway #3326
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
PR Review: Fix tunnel ack from gatewaySummaryThis PR fixes a critical bug in the tunnel acknowledgment mechanism where the gateway was generating a new UUID for the AnalysisThe Bug: Why This Matters: if (message.messageKind.tag === "TunnelAck") {
const msgIdStr = bufferToString(message.messageId);
const pending = this.#pendingTunnelMessages.get(msgIdStr);
if (pending) {
this.#pendingTunnelMessages.delete(msgIdStr);
}
}With the wrong
The Fix: Code Quality AssessmentPositives:
Concerns:
Performance Considerations
Security Considerations
Best Practices
VerdictLGTM with recommendations ✅ The fix is correct and necessary. The change properly implements the tunnel acknowledgment protocol. However, I strongly recommend:
This is a high-priority fix that should be merged quickly, but follow-up work on testing would be valuable. Review generated with Claude Code |
2769824 to
43b9be8
Compare
0bb481c to
158182f
Compare
PR Review: Fix tunnel ack from gatewaySummaryThis PR fixes a critical bug in the pegboard gateway's tunnel acknowledgment mechanism. The change is small but important. The BugBefore: When the gateway sent a After: The gateway now correctly echoes back the original Why This MattersLooking at the TypeScript runner code ( if (message.messageKind.tag === "TunnelAck") {
// Mark pending message as acknowledged and remove it
const msgIdStr = bufferToString(message.messageId);
const pending = this.#pendingTunnelMessages.get(msgIdStr);
if (pending) {
this.#pendingTunnelMessages.delete(msgIdStr);
}
}The runner uses the
Code Quality✅ Correct fix: The change properly echoes back the message ID from the incoming message Potential Concerns
RecommendationLGTM ✅ This is a critical bug fix that corrects the tunnel acknowledgment protocol. The fix is correct and should prevent memory leaks and state tracking issues in the runner. Consider adding integration tests to prevent regression of this issue in the future. |
Code ReviewSummaryThis PR fixes a critical bug in the tunnel acknowledgment mechanism where the gateway was generating a new UUID for the ack message instead of echoing back the original message_id. AnalysisThe Bug:
The Fix:
Why This Matters:
The bug broke this bidirectional acknowledgment protocol by returning the wrong message_id. Code Quality✅ Excellent - This is a minimal, surgical fix that addresses exactly the issue at hand Potential Issues
Performance Considerations✅ No impact - The fix actually has a tiny performance improvement (one fewer UUID generation) Security Concerns✅ None - The fix maintains the same security posture Recommendations
Convention Compliance✅ Code follows the repository's style guidelines per CLAUDE.md Verdict: LGTM - This is a well-identified bug fix that restores correct protocol behavior. Recommend merging. |
43b9be8 to
d922f4c
Compare
Pull Request ReviewSummaryThis PR fixes a critical bug in the tunnel acknowledgment flow from the gateway. The fix changes the message_id in the acknowledgment message from a newly generated UUID to the actual message_id from the incoming message. AnalysisThe Bug: Why This is a Problem:
Because the gateway was sending back a different message_id than what it originally sent, the runner's ack would never match any pending message. This would cause:
The Fix: Code Quality AssessmentStrengths:
Considerations:
Security & PerformanceSecurity: No security concerns. This is a bug fix that improves reliability. Performance: This fix actually improves performance by:
RecommendationLGTM with suggestions The fix is correct and addresses a real bug in the acknowledgment flow. However, I recommend:
Great catch on this bug! |
0f23c20 to
becb4b8
Compare
d922f4c to
202987a
Compare
|
Deployment failed with the following error: Learn More: https://vercel.com/docs/limits#rate-limits |
Code ReviewSummaryThis PR fixes a critical bug in the tunnel acknowledgment mechanism between the pegboard gateway and runners. The fix ensures that acknowledgment messages correctly reference the original message ID. Issue IdentifiedBefore: The gateway was generating a new UUID for the message_id: Uuid::new_v4().into_bytes(),After: The gateway now correctly echoes back the original message ID from the incoming message: message_id: msg.message_id,Impact AnalysisWhy This Bug MattersLooking at the runner-side code ( if (message.messageKind.tag === "TunnelAck") {
const msgIdStr = bufferToString(message.messageId);
const pending = this.#pendingTunnelMessages.get(msgIdStr);
if (pending) {
this.#pendingTunnelMessages.delete(msgIdStr);
}
}With the bug, the randomly generated
This would cause all tunnel messages (HTTP requests and WebSocket operations) to fail after 5 seconds, even though they were actually acknowledged by the gateway. Code Quality AssessmentPositive:
Suggestions:
Security ConsiderationsNo security concerns. This fix actually improves reliability by ensuring the acknowledgment protocol works correctly. Performance ConsiderationsPositive performance impact:
ConclusionLGTM ✅ This is an important bug fix that restores proper functionality of the tunnel acknowledgment system. The change is minimal, correct, and should be merged promptly. Recommendation: After merging, consider adding integration tests to prevent regression of this critical path. |
Merge activity
|
becb4b8 to
96c8a07
Compare
202987a to
0e9f26e
Compare
|
Deployment failed with the following error: Learn More: https://vercel.com/docs/limits#rate-limits |
Code ReviewSummaryThis PR fixes a critical bug in the tunnel acknowledgment mechanism within the pegboard gateway. The change correctly uses the original message ID from the incoming message when sending acknowledgments, rather than generating a new random UUID. AnalysisThe Bug: message_id: Uuid::new_v4().into_bytes(), // ❌ Wrong - generates new IDThe Fix: message_id: msg.message_id, // ✅ Correct - uses original IDWhy This MattersLooking at the TypeScript runner implementation (tunnel.ts:247-253), when a if (message.messageKind.tag === "TunnelAck") {
const msgIdStr = bufferToString(message.messageId);
const pending = this.#pendingTunnelMessages.get(msgIdStr);
if (pending) {
this.#pendingTunnelMessages.delete(msgIdStr);
}
}With the bug, the gateway was sending back a different message ID in the ack than what was originally sent. This means:
Correctness VerificationThe fix aligns with the protocol pattern seen throughout the codebase:
This is confirmed by examining lines 224-236 where incoming if let protocol::ToServerTunnelMessageKind::TunnelAck = &msg.message_kind {
in_flight.pending_msgs.retain(|m| m.message_id != msg.message_id);
}The gateway itself expects to receive back the original message ID when it sends messages to the runner. Impact AssessmentSeverity: High This bug would cause:
Testing RecommendationsWhile I don't see existing tests for this module, this change would benefit from:
Code Quality✅ Follows conventions: Uses existing message fields correctly VerdictLGTM - This is an excellent bug fix that corrects a fundamental protocol violation. The change is minimal, correct, and should be merged promptly to prevent acknowledgment tracking failures in production. Review generated with assistance from Claude Code |

No description provided.