Skip to content

feat(vm): update Go slot services without VM rebuild - #600

Merged
dofastted merged 3 commits into
mainfrom
fix/remote-slot-refresh
Oct 19, 2026
Merged

dofastted merged 3 commits into
mainfrom
fix/remote-slot-refresh

Conversation

@dofastted

@dofastted dofastted commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Add persistent per-slot slot-bin mounts for Docker and KVM cluster slots; publish kin-worker and kin-egress into them without rebuilding the VM.
  • Add service-only telemetry fleet action and wire it into the panel seed toggle and upgrade scripts; it restarts only Go services, not the Rust kernel or VM container.
  • Add the editable claude.setting default and telemetry operations documentation.

Verification

  • npm run build:worker and npm run build:egress
  • node --test test/unit/cluster-placement.test.mjs test/unit/remote-slot-restart-loop.test.mjs test/unit/telemetry-status.test.mjs test/unit/seed-policy.test.mjs test/unit/slot-seed.test.mjs
  • npx biome check ... and shell/Node syntax checks

No remote deployment was performed.


Note

Medium Risk
Touches slot mount layout (may recreate cluster containers), upgrade/install failure modes, and per-slot service restarts across local and remote nodes; VM kernels and credentials are intentionally untouched but mis-pushed binaries could break telemetry/egress per slot.

Overview
Adds persistent per-slot slot-bin mounts (layout v3) so kin-worker and kin-egress can be republished from the control-plane image at /opt/kin-live without rebuilding VM containers or bouncing the Rust kernel. Cluster Docker/KVM slots and remote kin-egress pick up new binaries via pushSlotBinaries; egress container identity now includes the binary digest.

Introduces a telemetry fleet action (POST /vms/fleet-update, scripts/fleet-services.mjs) that copies refreshed Go payloads, syncs run/seed files, stops/restarts only the telemetry child and kin-egress. Install/upgrade (refresh_slot_services, panel-upgrade.sh) run this after a healthy control-plane restart. Seed-settings PUT toggling telemetry (or explicit restart) uses the same path instead of a full slot reload.

Adds an editable claude.setting seed field (default CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1), written beside settings.json, exposed on panel seed-settings GET/PUT and the seed-policy UI, plus docs/TELEMETRY.md and API notes.

Reviewed by Cursor Bugbot for commit a7c3dfb. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 5 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a7c3dfb. Configure here.

digest.update(name).update(data)
pushed.push(name)
}
return { pushed, digest: digest.digest('hex') }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cluster binary digest is out of scope

High Severity

pushSlotBinaries updates a digest hasher that is created only inside pushSlotFiles, so the first digest.update throws ReferenceError. Cluster start, reload, and the new telemetry fleet action all call this path, so Go payloads never publish and those flows fail immediately.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a7c3dfb. Configure here.

Comment thread src/lib/cluster/remote-slot-files.mjs Outdated
const pushed = []
for (const name of SLOT_BINARIES) {
const local =
process.env[name === 'kin-worker' ? 'KIN_WORKER_BIN' : 'KIN_EGRESS_BIN'] || path.join(projectRoot, 'bin', name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ARM64 cluster live bins use host arch

High Severity

Live slot-bin publish reads KIN_WORKER_BIN / KIN_EGRESS_BIN (or bin/), not KIN_CLUSTER_WORKER_BIN / KIN_CLUSTER_EGRESS_BIN. On an ARM64 control plane those host binaries are not the amd64 payloads nodes already require for image builds, so published kin-worker / kin-egress fail with exec format errors.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a7c3dfb. Configure here.

const started = await ensureProxyEgress(projectRoot, vm.proxy)
if (!started?.ok) return { ok: false, action: 'egress_start_failed', error: started?.error || 'kin-egress failed' }
}
return { ...telemetry, egress: 'restarted' }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Local egress restart reuses the old process

High Severity

The local telemetry action SIGTERMs kin-egress and then calls ensureProxyEgress without waiting for that PID to exit. startEgressProcess still sees a live helper with an unchanged config and returns reused: true, so the new binary never execs even though the report says egress: 'restarted'.

Fix in Cursor Fix in Web

Triggered by learned rule: kin-egress reload waits for old process exit

Reviewed by Cursor Bugbot for commit a7c3dfb. Configure here.

action: telemetryEnabled === true ? 'restarted' : 'stopped',
remote_dir: remoteDir,
binary_digest: binaries.digest || null,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cluster service update skips live egress spec

High Severity

restartRemoteServices writes slot-bin then only docker restarts the existing egress helper and execs telemetry from /opt/kin-live (KVM: /opt/kin-payload/opt/kin-live). It never runs ensureRemoteEgress, so pre-layout-3 helpers keep the image Cmd and have no slot-bin bind. pkill still stops the old sidecar, and startRemoteTelemetry swallows exec failures, so telemetry can stay down while the action reports success.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a7c3dfb. Configure here.

settings_json: written.settings || null,
claude_setting: written.claude_setting || '',
kin_seed: written.kin_seed || null,
service,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seed save toasts success after service failure

Medium Severity

PUT /seed-settings still returns HTTP 200 ok when the nested telemetry fleet update fails, and the seed card always toasts 已播种. Operators can believe the sidecar restarted after toggling telemetry even though service.ok is false.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a7c3dfb. Configure here.

@cursor
cursor Bot force-pushed the fix/remote-slot-refresh branch from 1cc09a3 to 848c774 Compare October 19, 2026 09:14
@dofastted
dofastted merged commit 290ea36 into main Oct 19, 2026
7 checks passed
@dofastted
dofastted deleted the fix/remote-slot-refresh branch October 19, 2026 09:24
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.

2 participants