Files
LangBot/sdk/docs/box-instance-identity.md
0d84c334ba feat(sdk): move the plugin SDK into the monorepo with independent releases (LANG-420) (#2993)
* chore(sdk): import langbot-plugin-sdk v0.7.24 snapshot into sdk/ (LANG-420)

Snapshot of langbot-app/langbot-plugin-sdk at 76443bb8 (tag v0.7.24),
without history. The repository's .github/ workflows are not imported;
they are replaced by sdk-*.yml workflows in the next commit. The root
.gitignore keeps the template .vscode/launch.json.example tracked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(sdk): move the plugin SDK into the monorepo with independent releases (LANG-420)

- CI: sdk-tests.yml / sdk-box-docker.yml run the SDK suite from sdk/ in
  its own environment (Python 3.10-3.12); run-tests.yml gains a
  "Core with in-tree SDK" job that overlays sdk/ on Core's venv.
- Releases: sdk-publish.yml publishes langbot-plugin from sdk/vX.Y.Z tag
  pushes and never creates a GitHub Release. Core release workflows now
  only accept v* tags, and scripts/check_sdk_release_pin.py blocks a Core
  PyPI/Docker release whose langbot-plugin pin differs from the released,
  unchanged sdk/.
- Packaging: Core still installs the PyPI pin. Core wheel/sdist, git
  export, Docker context, release ZIP and fnOS package exclude sdk/.
- Generator/tests: generate_plugin_workspace_api.py writes sdk/ directly;
  the SDK's generator drift tests now run instead of skipping.
- Docs: AGENTS/ARCHITECTURE, sdk/ guides (+ RELEASING.md, SOURCE.json),
  agent skills and lbs probes, public docs (zh/en/ja) and dev-docs
  point at sdk/ instead of the sibling langbot-plugin-sdk checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-11 23:12:53 +08:00

2.3 KiB
Raw Permalink Blame History

Box instance identity

Startup cleanup removes only sandbox containers labeled with the current Box instance ID. Containers owned by other instances, including unlabeled legacy containers, are retained. Docker and Podman filter by both langbot.box=true and langbot.box.instance_id; nsjail requires both a matching session prefix and an exact instance_id in the session's meta.json.

Identity precedence is lbp box --instance-id, LANGBOT_BOX_INSTANCE_ID, then instance_id in LANGBOT_BOX_CONFIG. IDs contain 1–128 ASCII letters, digits, dots, colons, underscores or hyphens and start with a letter or digit. NsJail metadata checks prevent overlapping prefixes from confusing two owners.

Without explicit configuration, Box generates instance-id in its data directory once and reuses it after restarts. Choose the directory with --data-dir or LANGBOT_BOX_DATA_DIR; the default is data/box relative to the working directory. Give each deployment its own persistent directory. Preserve it across container recreation; do not copy it when cloning an instance. If persistence fails, Box uses a random ID, warns, and skips startup cleanup.

An OS file lock is held for the runtime lifetime. A second runtime using the same ID and data directory is rejected before cleanup. Failure to create the lock directory/file disables cleanup. Locks are released on shutdown or process exit. Explicitly reusing an ID with different data directories or on different hosts is not detected: operators sharing a Docker daemon must assign distinct IDs and must not run two owners of one ID concurrently.

Core-managed subprocesses receive Core's stable instance UUID. Standalone and sidecar runtimes establish their identity before accepting RPC connections; INIT does not change ownership or trigger cleanup and rejects a different instance_id. Configure their ID at launch or use a persistent data directory. Box identity is separate from the trusted Core identity used for authorization.

Cleanup logs list selected containers/directories. Other Docker owners are excluded by the daemon-side filter; nsjail logs skipped directories at DEBUG. No automatic unlabeled cleanup is provided. Old runtimes retain their old cleanup behavior until upgraded, so upgrade all runtimes sharing a daemon before relying on isolation from their startup cleanup.