Skip to content

feat: /update command — update roundhouse from Telegram#3

Merged
royosherove merged 1 commit into
mainfrom
feat/update-command
May 7, 2026
Merged

feat: /update command — update roundhouse from Telegram#3
royosherove merged 1 commit into
mainfrom
feat/update-command

Conversation

@royosherove
Copy link
Copy Markdown
Member

Adds /update command that:

  1. Runs npm install -g @inceptionstack/roundhouse@latest
  2. Shows progress via live-updating Telegram message
  3. Exits with code 75 so systemd Restart=on-failure brings it back with new code

Same allowlist guard as /restart.

- Runs 'npm install -g @inceptionstack/roundhouse@latest' in background
- Shows progress via editable Telegram message
- Exits with code 75 so systemd restarts with new code
- Requires allowlist (same as /restart)
@royosherove royosherove force-pushed the feat/update-command branch from fdc0bac to cceeea0 Compare May 7, 2026 11:28
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fdc0baca94

ℹ️ 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".

Comment thread src/gateway.ts Outdated
Comment on lines +491 to +494
const output = execSync("npm install -g @inceptionstack/roundhouse@latest 2>&1", {
timeout: 120_000,
encoding: "utf8",
});
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 Badge Avoid blocking the gateway during /update install

Replace the synchronous execSync call here with an async child process (spawn/exec) because this currently blocks the Node event loop for the full install window (up to the 120s timeout), during which the gateway cannot process any other chat events across threads. That makes /update temporarily freeze bot responsiveness and prevents true live progress updates while the install is running.

Useful? React with 👍 / 👎.

@royosherove royosherove merged commit 5e1cbe9 into main May 7, 2026
@royosherove royosherove deleted the feat/update-command branch May 7, 2026 11:30
royosherove added a commit that referenced this pull request May 14, 2026
…31) (#133)

* refactor(session-repair): beautify per code review (7 findings)

Addresses all 7 findings from the post-v0.5.30 maintainability review.
Pure refactor \u2014 zero behavior change. 536 tests passing (+2 new for the
divergent-change fix).

#1 + #7 \u2014 DRY: extract matchesErrorPatterns + fix divergent change
  isContextOverflowError and isToolPairingError shared ~80% of structure
  (top-level .message, cause-chain walk, stringify-gate, circular try/catch)
  but with subtle drift: only one walked the cause chain. Extracted
  matchesErrorPatterns(err, patterns, { stringifyGate }) shared helper.
  Both classifiers now ~7 lines and BOTH walk cause chains. Added 2 tests
  proving isToolPairingError now classifies wrapped/Bedrock-nested
  tool-pairing errors (regression guard for the divergent-change fix).
  Also extracted looksLikeValidationError() shared gate so the two
  classifiers don't repeat the 4xx/ValidationException check.

#2 \u2014 long method: extracted buildTrimmedEntries(entries, cutIdx) from
  softResetSessionFile. The orchestration is now linear: validate \u2192 cut
  \u2192 build \u2192 repair \u2192 write \u2192 report. Each step at the same abstraction
  level.

#3 \u2014 long catch with nested try: extracted attemptSoftResetRecovery()
  in lifecycle.ts. flushMemoryThenCompact catch block went from ~60
  lines with nested try/catch to ~25 lines, linear: classify \u2192 recover
  \u2192 log \u2192 persist.

#4 \u2014 magic number: MAX_CAUSE_CHAIN_DEPTH = 5 named constant.

#5 \u2014 file >400 lines: split src/agents/shared/session-repair.ts (574
  lines, two domains) into:
    - session-repair.ts (81 lines) \u2014 public surface, tool-pair repair,
      re-exports for backward compat
    - session-soft-reset.ts (120 lines) \u2014 softResetSessionFile + types
    - error-classifiers.ts (75 lines) \u2014 matchesErrorPatterns +
      isContextOverflowError + isToolPairingError + MAX_CAUSE_CHAIN_DEPTH
    - session-repair-internal.ts (239 lines) \u2014 shared filesystem +
      in-memory repair primitives
  All public exports preserved via re-exports (Feathers seam pattern).
  Existing callers compile unchanged.

#6 \u2014 naming: introduced RepairResult { entries, report } named type for
  the previously-anonymous repairEntriesInMemory return shape. Better
  IDE hover/autocomplete; no inline destructuring noise at call sites.

Verification:
  npm test \u2014 536 passing (was 534, +2 for cause-chain regression tests)
  wc -l src/agents/shared/session-repair.ts \u2014 81 (was 574)
  All public API surfaces preserved.

* chore: bump to v0.5.31 + CHANGELOG

---------

Co-authored-by: Roy Osherove <575051+royosherove@users.noreply.github.com>
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