oneliner fixes - #70
Conversation
set device_id correctly handle 409 more robust script flow better handling of halting conditions
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/stdiod/scripts/install-beeper.sh">
<violation number="1" location="crates/stdiod/scripts/install-beeper.sh:198">
P2: Passing a non-numeric `--beeper-wait` value triggers Bash’s raw `integer expression expected` error and silently skips the wait branch. Validate `--beeper-wait` as a non-negative integer during flag parsing and fail via `die()`.</violation>
<violation number="2" location="crates/stdiod/scripts/install-beeper.sh:418">
P3: If the `mv` after this line fails (disk full during a cross-filesystem copy, etc.), the previously installed `sealgate-stdiod` binary is already gone, leaving the PATH entry pointing at nothing. Remove the destination only as part of a successful replace, e.g. copy to a temp name and `mv -f` the temp over the destination, so a failed install keeps the old binary intact.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| --server-name) needval $# "$1" "${2:-}"; SERVER_NAME="$2"; shift 2;; | ||
| --device-label) needval $# "$1" "${2:-}"; DEVICE_LABEL="$2"; shift 2;; | ||
| --oauth-wait) needval $# "$1" "${2:-}"; OAUTH_WAIT="$2"; shift 2;; | ||
| --beeper-wait) needval $# "$1" "${2:-}"; BEEPER_WAIT="$2"; shift 2;; |
There was a problem hiding this comment.
P2: Passing a non-numeric --beeper-wait value triggers Bash’s raw integer expression expected error and silently skips the wait branch. Validate --beeper-wait as a non-negative integer during flag parsing and fail via die().
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/stdiod/scripts/install-beeper.sh, line 198:
<comment>Passing a non-numeric `--beeper-wait` value triggers Bash’s raw `integer expression expected` error and silently skips the wait branch. Validate `--beeper-wait` as a non-negative integer during flag parsing and fail via `die()`.</comment>
<file context>
@@ -191,6 +195,7 @@ parse_flags() {
--server-name) needval $# "$1" "${2:-}"; SERVER_NAME="$2"; shift 2;;
--device-label) needval $# "$1" "${2:-}"; DEVICE_LABEL="$2"; shift 2;;
--oauth-wait) needval $# "$1" "${2:-}"; OAUTH_WAIT="$2"; shift 2;;
+ --beeper-wait) needval $# "$1" "${2:-}"; BEEPER_WAIT="$2"; shift 2;;
--no-open) NO_OPEN=1; shift;;
--relogin) RELOGIN=1; shift;;
</file context>
| --beeper-wait) needval $# "$1" "${2:-}"; BEEPER_WAIT="$2"; shift 2;; | |
| --beeper-wait) needval $# "$1" "${2:-}"; BEEPER_WAIT="$2"; case "$BEEPER_WAIT" in ''|*[!0-9]*) die "flag '$1' needs a non-negative integer" "example: $1 30";; esac; shift 2;; |
| # kernel's cached signing state for that vnode goes stale - the binary then | ||
| # dies with SIGKILL. `mv` across filesystems degrades to a copy, so this is | ||
| # not hypothetical. | ||
| rm -f "$dest/sealgate-stdiod" |
There was a problem hiding this comment.
P3: If the mv after this line fails (disk full during a cross-filesystem copy, etc.), the previously installed sealgate-stdiod binary is already gone, leaving the PATH entry pointing at nothing. Remove the destination only as part of a successful replace, e.g. copy to a temp name and mv -f the temp over the destination, so a failed install keeps the old binary intact.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/stdiod/scripts/install-beeper.sh, line 418:
<comment>If the `mv` after this line fails (disk full during a cross-filesystem copy, etc.), the previously installed `sealgate-stdiod` binary is already gone, leaving the PATH entry pointing at nothing. Remove the destination only as part of a successful replace, e.g. copy to a temp name and `mv -f` the temp over the destination, so a failed install keeps the old binary intact.</comment>
<file context>
@@ -406,6 +411,11 @@ install_stdiod_prebuilt() {
+ # kernel's cached signing state for that vnode goes stale - the binary then
+ # dies with SIGKILL. `mv` across filesystems degrades to a copy, so this is
+ # not hypothetical.
+ rm -f "$dest/sealgate-stdiod"
mv "$dir/$asset" "$dest/sealgate-stdiod"
rm -rf "$dir"
</file context>
set device_id correctly
handle 409
more robust script flow
better handling of halting conditions
Summary by cubic
Fixes device identity and hardens the Beeper install flow. Previously login could save a hostname-based device_id and cause 403s on tunnel requests; it now always saves the backend-issued device_id. The installer waits for Beeper and the daemon to be ready and correctly handles HTTP 409 name conflicts.
Sets
device_idfrom the access token insealgate-stdiod loginto match the backend-bound device and avoid 403s.Simplifies the missing
device_idconfig error text.Robust install script:
BEEPER_WAIT,--beeper-wait).CONNECT_WAIT), parsingstate.jsonand clearing stale state pre-start.<name>-<uid-prefix>), and surfaces clear next actions.npx @beeper/mcp-remotewith the optional endpoint when present.Review/rollout:
sealgate-stdiod server remove <name>.needs_reauth, re-run install with--relogin. Approve the server in the dashboard after submission.Written for commit 08fcfd1. Summary will update on new commits.