Add error handling for gateway startup#398
Conversation
Handle errors during gateway startup by destroying the gateway if an error occurs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA try/catch now wraps the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@bin/lib/onboard.js`:
- Around line 879-884: The catch block references a non-existent
destroyGateway() causing a ReferenceError; replace that call with the existing
cleanup pattern used earlier (the shell-command-based teardown used around line
334) so the gateway is properly torn down and the original error is rethrown.
Specifically, inside the catch for startGateway, invoke the same async
shell/teardown helper (or inline shell command invocation) used at line 334
instead of destroyGateway(), await its completion, then rethrow the caught
error.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e68f5694-f208-4e0c-856b-6a2774a95e62
📒 Files selected for processing (1)
bin/lib/onboard.js
CodeRabbitAI review identified destroyGateway() as undefined.
Using the shell command pattern from line 334 instead:
run("openshell gateway destroy -g nemoclaw 2>/dev/null || true", { ignoreError: true });
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@bin/lib/onboard.js`:
- Around line 879-884: The catch block after startGateway(gpu) contains a syntax
error (a stray "();") and an unnecessary await on run; fix the catch to call
run("openshell gateway destroy -g nemoclaw 2>/dev/null || true", { ignoreError:
true }); (no trailing "();" and remove the await) and reformat the indentation
to match the file's 2-space style; this change should be applied in the catch
that references startGateway and run to restore valid parsing and follow the
existing synchronous run usage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ebc76d14-fa5b-42a3-b8bf-354e1cb954cb
📒 Files selected for processing (1)
bin/lib/onboard.js
CodeRabbitAI review flagged: - Syntax error: trailing (); will cause a parse failure - Unnecessary await since run() is synchronous Fixed by using the correct shell command pattern from line 334.
|
@coderabbitai Review completed — all feedback has been addressed:
Ready for maintainer review. Thank you! |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 2654 🏁 Script executed: Length of output: 896
One minor observation: the indentation in the new try {
await startGateway(gpu);
} catch (error) {
run("openshell gateway destroy -g nemoclaw 2>/dev/null || true", { ignoreError: true });
throw error;
}Otherwise, the logic is sound and ready for a maintainer review. 🚀 |
The try/catch block around startGateway() had inconsistent indentation
with the surrounding code style. Fixed to use consistent 2-space
indentation throughout the block.
- try { and } catch (error) { now use 2 spaces
- Block contents (await startGateway, run, throw) now use 4 spaces
- Matches the surrounding function body indentation
|
@coderabbitai Indentation fix committed — the try/catch block now uses consistent 2-space indentation to match the surrounding code style:
All checks passing. Ready for maintainer review. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 872
try {
await startGateway(gpu);
} catch (error) {
run("openshell gateway destroy -g nemoclaw 2>/dev/null || true", { ignoreError: true });
throw error;
}All three concerns from the review are now fully addressed:
The PR is in great shape — ready for maintainer review. 🚀 |
|
Thanks for tackling gateway startup error handling. The gateway lifecycle code has been refactored significantly since March. Could you rebase against main to check for conflicts? The error handling intent is sound — we'd like to get this reviewed once it's current. |
|
Following up on the April 14 rebase request. The gateway lifecycle code continues to evolve, and we'd like to get this error handling merged — could you find time to rebase against main? If we don't hear back within 7 days, we'll close this PR to keep the queue healthy. |
|
Closing due to inactivity. This PR has had merge conflicts for 7+ days without an update. Feel free to reopen once it's rebased against the latest main, or open a new PR to continue the work. Thanks for contributing to NemoClaw. |
Handle errors during gateway startup by destroying the gateway if an error occurs.
Summary by CodeRabbit