Skip to content

Comments

kiloclaw: remove IPv4 anycast address provisioning for Fly apps#482

Open
kiloconnect[bot] wants to merge 2 commits intomainfrom
session/agent_4de63a5a-9ee5-4192-a1d5-35c3ddc9a446
Open

kiloclaw: remove IPv4 anycast address provisioning for Fly apps#482
kiloconnect[bot] wants to merge 2 commits intomainfrom
session/agent_4de63a5a-9ee5-4192-a1d5-35c3ddc9a446

Conversation

@kiloconnect
Copy link
Contributor

@kiloconnect kiloconnect bot commented Feb 23, 2026

Summary

Remove the shared IPv4 (anycast) address provisioning from the KiloClaw Cloudflare worker. Only IPv6 is needed for Fly app connectivity — the shared IPv4 allocation was unnecessary overhead.

What changed

kiloclaw/src/durable-objects/kiloclaw-app.ts

  • Removed the ipv4Allocated class property and its tracking in loadState()/destroyApp()
  • Removed Step 3 (shared IPv4 allocation) from ensureApp()
  • Updated isSetupComplete() to only check ipv6Allocated && envKeySet
  • Simplified the app creation guard from !ipv4Allocated || !ipv6Allocated to !ipv6Allocated
  • Kept ipv4Allocated in the Zod schema for backward compatibility with existing DO storage (old DOs may still have this key persisted; it's parsed but ignored)

kiloclaw/src/fly/apps.ts

  • Renamed allocateIP()allocateIPv6() since it's no longer generic (only v6 is used)
  • Removed the ipType parameter and shared_v4 type union
  • Hardcoded type: 'v6' in the request body

kiloclaw/src/durable-objects/kiloclaw-app.test.ts

  • Updated all mocks from allocateIPallocateIPv6
  • Removed the "IPv6 done, IPv4 pending" partial-state resume test (no longer applicable)
  • Removed the "IPv4 allocation fails after IPv6 succeeds" test
  • Updated remaining tests to reflect single IPv6 allocation instead of dual allocation

kiloclaw/src/fly/apps.test.ts

  • Renamed test suite from allocateIPallocateIPv6
  • Removed the "sends shared_v4 type for IPv4" test
  • Updated all test calls to use the new 2-arg signature

kiloclaw/AGENTS.md

  • Updated file tree comment to say "allocate IPv6" instead of "allocate IPs"

Verification

  • All 329 kiloclaw tests pass ✅
  • TypeScript typecheck clean ✅
  • No other code in the worker references allocateIP or shared_v4
  • No DNS A-record creation was found (Fly handles DNS via its own anycast infrastructure)

Built for Florian by Kilo for Slack

Only IPv6 is needed — shared IPv4 allocation was unnecessary overhead.

Changes:
- Remove shared_v4 IP allocation step from KiloClawApp DO ensureApp()
- Remove ipv4Allocated state tracking from DO (kept in schema for
  backward compat with existing DO storage)
- Rename allocateIP() to allocateIPv6() in fly/apps.ts (no longer
  generic since only v6 is used)
- Update isSetupComplete() to only check ipv6Allocated + envKeySet
- Remove IPv4-specific test cases, update remaining tests
- Update AGENTS.md docs
@kiloconnect
Copy link
Contributor Author

kiloconnect bot commented Feb 23, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Clean refactoring that removes shared IPv4 allocation from the Fly App lifecycle, keeping only IPv6. The changes are consistent across the implementation (allocateIPallocateIPv6), the Durable Object (ipv4Allocated removed from runtime state), documentation, and tests. The AppStateSchema correctly retains ipv4Allocated for backward compatibility with existing DOs that may have it in storage.

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
kiloclaw/AGENTS.md 73 Minor: still says "Fly Apps + IP allocation REST API" — could be updated to "Fly Apps + IPv6 allocation REST API" for consistency with the rest of the changes
Files Reviewed (4 files)
  • kiloclaw/AGENTS.md - 0 issues
  • kiloclaw/src/fly/apps.ts - 0 issues
  • kiloclaw/src/fly/apps.test.ts - 0 issues
  • kiloclaw/src/durable-objects/kiloclaw-app.ts - 0 issues
  • kiloclaw/src/durable-objects/kiloclaw-app.test.ts - 0 issues

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