Skip to content

fix(kiloclaw): omit ord from Fly region list due to provisioning issues#1090

Merged
jrf0110 merged 2 commits intomainfrom
claw-region-hint
Mar 13, 2026
Merged

fix(kiloclaw): omit ord from Fly region list due to provisioning issues#1090
jrf0110 merged 2 commits intomainfrom
claw-region-hint

Conversation

@jrf0110
Copy link
Copy Markdown
Contributor

@jrf0110 jrf0110 commented Mar 13, 2026

Summary

  • Replace the us geographic alias in FLY_REGION with explicit US regions (dfw,ewr,iad,lax,sjc) to exclude ord, which is experiencing provisioning failures. Updated wrangler.jsonc (production config), DEFAULT_FLY_REGION in config.ts, and corresponding test assertions.
  • Revert fix(kiloclaw): reverse region list on capacity recovery #1059 (reverse region list on capacity recovery). With explicit region codes instead of the us alias, deprioritizeRegion can now correctly match concrete regions (e.g. iad) against the list — the original bug where meta-region us never matched concrete codes no longer applies. Restores shuffleRegions + deprioritizeRegion in replaceStrandedVolume.

Verification

  • pnpm test — all 596 tests pass (kiloclaw)

Visual Changes

N/A

Reviewer Notes

This is a workaround to stop provisioning attempts in ord. Once the region is healthy again, we can add ord back to the explicit list. The revert of #1059 is safe because the root cause (meta-region us not matching concrete region codes like ord) is eliminated by switching to explicit region codes.

Comment thread kiloclaw/src/config.ts
export const DEFAULT_FLY_REGION = 'us,eu';
* Callers shuffle before selecting so order here doesn't matter.
* ord omitted due to provisioning issues. */
export const DEFAULT_FLY_REGION = 'dfw,ewr,iad,lax,sjc,eu';
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.

WARNING: eu remains an invalid volume fallback target

ensureVolume() and the 412 recovery path pass this list straight into createVolumeWithFallback(), and that helper explicitly expects concrete Fly region codes for volume creation. Leaving eu here means the fallback still throws as soon as it reaches the Europe entry instead of provisioning in an actual EU region.

Comment thread kiloclaw/wrangler.jsonc
"FLY_ORG_SLUG": "kilo-679", // Org for creating per-user Fly apps
"FLY_IMAGE_TAG": "latest",
"FLY_REGION": "us,eu",
"FLY_REGION": "dfw,ewr,iad,lax,sjc,eu",
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.

WARNING: eu can still break fresh provisioning here

New volume placement shuffles FLY_REGION before calling createVolumeWithFallback(), which only supports concrete region codes. Because eu can end up first in the shuffled list, fresh provisions can fail immediately with an invalid-region error before any valid region is tried.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Mar 13, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
kiloclaw/src/durable-objects/kiloclaw-instance.test.ts 2162 Sorting the recovery region list only checks membership, so the test no longer verifies that the failed region is actually deprioritized.

Fix these issues in Kilo Cloud

Other Observations (not in diff)

N/A

Files Reviewed (4 files)
  • kiloclaw/src/config.ts - 0 issues
  • kiloclaw/src/durable-objects/kiloclaw-instance.test.ts - 1 issue
  • kiloclaw/src/durable-objects/kiloclaw-instance/fly-machines.ts - 0 issues
  • kiloclaw/wrangler.jsonc - 0 issues

Reviewed by gpt-5.4-20260305 · 559,390 tokens

…1059)

With explicit region codes instead of the 'us' alias, deprioritizeRegion
can now correctly match concrete regions (e.g. 'iad') against the list.
The original bug — meta-region 'us' never matching concrete region codes —
no longer applies.
expect(regions412Call[2]).toEqual(['eu', 'us']);
// Regions are shuffled, so just check the set (deprioritize is a no-op here
// because 'iad' is not in FLY_REGION='dfw,ewr,iad,lax,sjc,eu')
expect((regions412Call[2] as string[]).sort()).toEqual([
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.

WARNING: This assertion no longer verifies the recovery ordering

Sorting regions412Call[2] turns the check into a pure set comparison, so the test still passes if deprioritizeRegion() stops moving the failed region to the end and recovery retries the constrained host first. Because this change is specifically about ordering, the assertion should verify the failed region's position instead of sorting it away.

@jrf0110 jrf0110 merged commit 82b7c49 into main Mar 13, 2026
18 checks passed
@jrf0110 jrf0110 deleted the claw-region-hint branch March 13, 2026 17:33
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