Skip to content

refactor: extract shared telemetron sidecar installer#54

Merged
royosherove merged 1 commit intomainfrom
refactor/common-telemetron
May 6, 2026
Merged

refactor: extract shared telemetron sidecar installer#54
royosherove merged 1 commit intomainfrom
refactor/common-telemetron

Conversation

@royosherove
Copy link
Copy Markdown
Member

Moves ~230 lines of duplicated telemetron logic from openclaw and roundhouse packs into packs/common-telemetron.sh.

Each pack now calls:

source "${SCRIPT_DIR}/../common-telemetron.sh"
install_telemetron <mode>

Changes:

  • New packs/common-telemetron.sh — single install_telemetron <mode> public API
  • packs/openclaw/install.sh — removed 104 lines of inline telemetron code
  • packs/roundhouse/install.sh — removed 124 lines of inline telemetron code

Design:

  • Uses telemetron detect (not legacy env vars) — auto-discovers by install dir
  • sudo preserves SUDO_USER so telemetron resolves correct home dir
  • Subshell isolation: never fails the caller
  • curl --retry 3 for network resilience

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

source "${SCRIPT_DIR}/../common-telemetron.sh"
install_telemetron openclaw

P2 Badge Keep OpenClaw test contract when extracting telemetron logic

This refactor removes should_run_telemetron() from packs/openclaw/install.sh, but packs/openclaw/test.sh still extracts that function from this file and now fails with could not extract should_run_telemetron (repro: bash packs/openclaw/test.sh). That makes the existing OpenClaw pack validation fail after this commit, so the refactor should either update the test harness to source common-telemetron.sh or preserve a compatibility wrapper in install.sh.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@royosherove royosherove force-pushed the refactor/common-telemetron branch from eed963c to 31365c4 Compare May 6, 2026 15:28
@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

timeout 30 sudo "$bin" detect \

P2 Badge Make telemetron sudo invocation non-interactive

The new shared installer calls sudo directly for telemetron detect without -n or a prior non-interactive capability check. In environments where sudo requires a password (or no controlling TTY is available), this can block until the timeout and may still prompt on /dev/tty, which breaks the sidecar contract of being silent and best-effort after pack success. The previous path used a sudo -n true gate before attempting privileged execution, so this introduces a user-visible regression on non-passwordless setups.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@royosherove royosherove force-pushed the refactor/common-telemetron branch from 31365c4 to d3a878e Compare May 6, 2026 15:33
@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

timeout 30 sudo "$bin" detect \
--endpoint "$_TELEMETRON_ENDPOINT" \
--enroll-endpoint "$_TELEMETRON_ENROLL_ENDPOINT" \
--mode "$mode" \
--force >>"$log" 2>&1 || {

P2 Badge Avoid interactive sudo in optional telemetron flow

Calling sudo unconditionally in install_telemetron can block installs in environments without passwordless sudo (for example, when a user has sudo access but must enter a password), which makes this best-effort sidecar stall for up to the timeout window after the pack reports success. In the previous openclaw path, sudo execution was gated by a non-interactive check, so this introduces a regression in install latency and UX for non-NOPASSWD setups.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Move duplicated telemetron logic (~230 lines) from openclaw and roundhouse
pack installers into packs/common-telemetron.sh.

Each pack now calls:
  source common-telemetron.sh
  install_telemetron <mode>

The shared helper:
- Gates on platform/opt-out checks
- Detects AWS account tier (internal/external)
- Writes tier files for telemetron to read
- Installs binary via sudo (with retry)
- Runs 'telemetron detect --mode <mode>' for auto-discovery

Uses the modern 'detect' approach (not legacy env vars), which
auto-discovers sessions by install directory (v0.5.2+).
@royosherove royosherove force-pushed the refactor/common-telemetron branch from d3a878e to be66929 Compare May 6, 2026 15:41
@royosherove royosherove merged commit 83f371f into main May 6, 2026
16 checks passed
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