Skip to content

feat(kbc): rename compile box image to siclaw-kbc-box and pod prefix to kbc-box#442

Closed
LikiosSedo wants to merge 1 commit into
mainfrom
feat/kbcbox-naming
Closed

feat(kbc): rename compile box image to siclaw-kbc-box and pod prefix to kbc-box#442
LikiosSedo wants to merge 1 commit into
mainfrom
feat/kbcbox-naming

Conversation

@LikiosSedo

Copy link
Copy Markdown
Collaborator

Motivation (operations)

During production troubleshooting every pod is named agentbox-<id>, so a KB compile box and a chat agentbox can only be told apart by label/image filtering — the compile box has bitten on-call more than once. This makes the compile box distinguishable at a glance in kubectl get pods.

Changes

  • Image rename kbc-compile-boxsiclaw-kbc-box: Makefile build/push targets, helm siclaw.compileBoxImage derivation, values.yaml, README/docs. The explicit agentbox.compileBoxImage override semantics are unchanged.
  • Pod-name prefix declared on the BoxProfile (podNamePrefix, platform-style — no if profile== in the spawner): kb-compile and kb-compile-codex spawn as kbc-box-<id> instead of agentbox-<id>. Resources derived from the pod name (cert Secret, hostname) follow the prefix. Chat agentboxes and the read-only, ephemeral kb-test box keep the agentbox- prefix (see note below).
  • Upgrade compatibility (auto-cleanup): on the first post-upgrade compile spawn, the spawner reaps any pod left under the old agentbox-<id> name for that agent — guarded to compile boxes only (boxType label kb-compile*), so a chat box under the same name is never touched. This prevents the old and new pods from coexisting after upgrade.
  • Manager kept consistent with the spawner: AgentBoxManager independently computes the pod name for warm-reuse / liveness / stop, and it sits on the capability reap+adopt path. Its lookup is now profile-aware, and stop(runId, profile) / getAsync(runId, profile) receive the run's profile. Without this, the capability reap would 404 on the old agentbox- name and leak the renamed compile pod, and adopt would miss the live box after a runtime restart.

Transition (one release cycle)

  • make push-kbc double-pushes the same image digest under the legacy name kbc-compile-box so runtimes still pinned to it during the rename window keep resolving. Remove the legacy tag/push next release.
  • DevOps action required: add a registry replication rule (ap-southeast → cn-shanghai) for siclaw-kbc-box. The old kbc-compile-box was not in the replication rule and had to be pushed to Shanghai by hand; the new name needs a rule so this stops being manual. Until the rule lands, push siclaw-kbc-box to cn-shanghai manually for production.

Verification

  • helm template smoke: compileBoxEnabled=true renders SICLAW_COMPILE_BOX_IMAGE = {registry}/siclaw-kbc-box:{tag}; explicit compileBoxImage override passes through unchanged; default stays dark (no env, fail-closed).
  • Unit tests green for box-profile, k8s-spawner, and manager suites, including new coverage for: the kbc-box prefix on compile pods (chat stays agentbox), the legacy-pod reap on upgrade, the chat-pod guard (never reaped), and the profile-aware stop / getAsync lookups.

Note / scope decision

Per the spec, only the two compile profiles get the kbc-box prefix. The read-only kb-test box (short-lived, discarded after a test session, still on the siclaw-kbc-box image) keeps the agentbox- prefix. If we want test-session boxes distinguishable too, that is a one-line follow-up (podNamePrefix on kb-test), but it was intentionally left out of scope here.

…to kbc-box

Motivation (operations): during production troubleshooting every pod was
named `agentbox-<id>`, so a KB compile box and a chat agentbox could only be
told apart by label/image filtering — the compile box has bitten on-call more
than once. Make the compile box distinguishable at a glance.

Changes:
- Image rename `kbc-compile-box` -> `siclaw-kbc-box` (Makefile build/push,
  helm `siclaw.compileBoxImage` derivation, values, README/docs). The explicit
  `agentbox.compileBoxImage` override semantics are unchanged.
- Pod-name prefix declared on the BoxProfile (`podNamePrefix`): `kb-compile`
  and `kb-compile-codex` spawn as `kbc-box-<id>` instead of `agentbox-<id>`.
  Derived resources (cert Secret, hostname) follow the prefix. Chat agentboxes
  and the read-only, ephemeral `kb-test` box keep the `agentbox-` prefix.
- Upgrade compatibility: on the first post-upgrade compile spawn the spawner
  reaps any pod left under the old `agentbox-<id>` name for that agent (guarded
  to compile boxes only — a chat box under the same name is never touched), so
  old and new pods do not coexist.
- Keep AgentBoxManager consistent with the spawner: its pod-name lookup is now
  profile-aware too, and `stop(runId, profile)` / `getAsync(runId, profile)`
  receive the run's profile. Without this the capability reap would 404 on the
  old name and leak the renamed compile pod, and adopt would miss the live box.

Transition:
- `make push-kbc` double-pushes the same image digest under the legacy name
  `kbc-compile-box` for one release cycle so runtimes still pinned to it keep
  resolving. Remove the legacy tag/push next release.
- DevOps: add a registry replication rule (ap-southeast -> cn-shanghai) for
  `siclaw-kbc-box` (the old name was not in the rule and had to be pushed by
  hand). Until then, push `siclaw-kbc-box` to cn-shanghai manually for prod.

Tests: box-profile / k8s-spawner / manager suites green, including new coverage
for the kbc-box prefix, the legacy-pod reap, the chat-pod guard, and the
profile-aware stop/getAsync lookups.
@LikiosSedo

Copy link
Copy Markdown
Collaborator Author

Consolidated into #446 per owner request; review history stays here. This PR will be closed once the batch merges.

LikiosSedo added a commit that referenced this pull request Jul 23, 2026
…le pods

Integration fix for the #442 × #444 merge interaction. #442 renamed the
compile-box pod prefix (agentbox- → kbc-box-, profile-derived) and updated
onReap/onAdopt to pass rec.profile, but left the other capability call sites
resolving the pod name with the default "agentbox" prefix. On main that was
correct (every box was agentbox-); after the rename those sites silently point
at a pod name the compile box no longer uses, so in K8s mode:

  - capability.testClose reports a LIVE test session as already-closed
  - capability.testSessions (new in #444, which reused testClose's pattern)
    lists no sessions for a live compile run
  - capability.cancel and the ensureCapabilitySession cleanup paths 404 on
    stop() and leak the pod instead of reaping it (ghost cleanup)

Pass the run's profile at every capability-box site so getAsync/stop build the
kbc-box- prefix. The profile comes from the in-memory run record, or — for the
restart-safe paths (testClose/testSessions/cancel) where the record may be gone
— is recovered from the consumer store via adopt(notifyOnAdopt:false), which
never reattaches a relay or spawns a box. Unknown profile falls back to the
default prefix (the pre-rename behavior).

Chat-agent paths (chat.sessionStatus, agent.clearMemory, agent.terminate) are
intentionally left on the default prefix — they operate on chat agentIds, not
capability runs.

Tests: memory-cold testClose/testSessions now assert getAsync is called with
the recovered "kb-compile" profile (→ kbc-box-<id>); cancel asserts stop carries
the profile for both in-memory and store-only runs.
@LikiosSedo

Copy link
Copy Markdown
Collaborator Author

Superseded by #446 (platform hardening batch); branch retained.

@LikiosSedo LikiosSedo closed this Jul 23, 2026
pull Bot pushed a commit to TheTechOddBug/siclaw that referenced this pull request Jul 23, 2026
Rename compile box image to siclaw-kbc-box and pod prefix to kbc-box; upgrade cleans old pods.
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