Skip to content

oneliner fixes - #70

Merged
dimitriosGX merged 1 commit into
mainfrom
dk-stdiod
Aug 21, 2026
Merged

oneliner fixes#70
dimitriosGX merged 1 commit into
mainfrom
dk-stdiod

Conversation

@dimitriosGX

@dimitriosGX dimitriosGX commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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_id from the access token in sealgate-stdiod login to match the backend-bound device and avoid 403s.

  • Simplifies the missing device_id config error text.

  • Robust install script:

    • Verifies Beeper Desktop is actually installed via artifact presence, opens it on macOS, and optionally waits for the client API (BEEPER_WAIT, --beeper-wait).
    • Waits for the daemon to register with the backend before submitting the server (CONNECT_WAIT), parsing state.json and clearing stale state pre-start.
    • Treats server add HTTP 409 as “name taken”; auto-retries once with a user-scoped fallback name (<name>-<uid-prefix>), and surfaces clear next actions.
    • Unlinks the existing binary before install to avoid stale Mach-O code signatures on macOS.
    • Keeps server submission gated until both Beeper is reachable and the daemon is connected; otherwise logs what to fix and how to re-run.
    • Submits the server as npx @beeper/mcp-remote with the optional endpoint when present.
  • Review/rollout:

    • No data migrations. The install script is idempotent and adopts a previously suffixed server name if found.
    • If a prior request exists with an outdated command, remove it and re-run: sealgate-stdiod server remove <name>.
    • If the daemon shows 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.

Review in cubic

set device_id correctly

handle 409

more robust script flow

better handling of halting conditions
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
--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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@dimitriosGX
dimitriosGX merged commit 25dbb4c into main Aug 21, 2026
5 checks passed
@dimitriosGX
dimitriosGX deleted the dk-stdiod branch August 21, 2026 19:15
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