Skip to content

fix(sandbox): sanitize @ in container names for WhatsApp LID chat IDs#1031

Open
kamushadenes wants to merge 1 commit into
nextlevelbuilder:devfrom
kamushadenes:fix/sandbox-sanitize-at-sign
Open

fix(sandbox): sanitize @ in container names for WhatsApp LID chat IDs#1031
kamushadenes wants to merge 1 commit into
nextlevelbuilder:devfrom
kamushadenes:fix/sandbox-sanitize-at-sign

Conversation

@kamushadenes
Copy link
Copy Markdown

Summary

sanitizeKey() in internal/sandbox/docker.go replaces :, /, , . with - but misses @. WhatsApp LID-format chat IDs like 551152861098:5@s.whatsapp.net produce container names containing @, which Docker rejects as invalid.

  • Add "@", "-" to the strings.NewReplacer call
  • Add test case with a realistic WhatsApp LID key

Test plan

  • go test ./internal/sandbox/ -run TestSanitizeKey passes
  • WhatsApp-triggered agent sessions create sandbox containers successfully

Fixes #1029

WhatsApp LID-format chat IDs contain @ (e.g. 551152861098:5@s.whatsapp.net)
which is invalid in Docker container names, causing sandbox creation to fail
for any WhatsApp-triggered agent session.

Add @ to the sanitizeKey replacer alongside the existing : / . and space
characters. Adds a test case with a realistic WhatsApp LID key.

Fixes nextlevelbuilder#1029

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kamushadenes added a commit to kamushadenes/nix that referenced this pull request Apr 24, 2026
Re-enable the Docker sandbox overlay (docker-compose.sandbox.yml) now that
the @ container naming bug has a fix (kamushadenes/goclaw fork, upstream
PR nextlevelbuilder/goclaw#1031).

- Custom sandbox image (goclaw-sandbox:custom) extends bookworm-slim with
  pre-installed CLIs: gh, gcloud, vt, fleetctl
- Override GOCLAW_SANDBOX_NETWORK=true so sandboxed CLIs can reach external
  APIs (GitHub, Google Cloud, VirusTotal, Fleet)
- ExecStartPre builds the custom image on first boot (cached after)
- Remove the manual docker-socket overlay — sandbox.yml already mounts it
- Point goclaw-repo to kamushadenes fork until #1031 merges upstream

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kamushadenes added a commit to kamushadenes/goclaw that referenced this pull request Apr 24, 2026
@kamushadenes kamushadenes changed the base branch from main to dev April 24, 2026 23:01
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.

Bug: sandbox container name invalid — @ in WhatsApp chat ID breaks Docker naming

1 participant