Skip to content

fix(wix-vibe-headless): write wix-config.js only when it still holds placeholders - #985

Merged
ayal merged 1 commit into
mainfrom
fix/host-written-wix-config-wins
Aug 12, 2026
Merged

fix(wix-vibe-headless): write wix-config.js only when it still holds placeholders#985
ayal merged 1 commit into
mainfrom
fix/host-written-wix-config-wins

Conversation

@ayal

@ayal ayal commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Why

Base44 now writes src/rest/wix-config.js at app creation (apper#20021), from the client id on the create request and a site id resolved from the Wix API — neither passes through a prompt.

deploy.cjs runs after that, on the agent's first turn, and writeWixConfig was an unconditional writeFileSync. So the agent's prompt-transcribed ids overwrote the host's correct ones, and the transcription this file exists to remove was straight back in. Without this change the platform-side write has no effect on Base44.

Change

Write only when the file still holds the placeholders. A config already carrying values is left exactly as it is — no comparison, no precedence rules, no reporting of what was ignored. It doesn't matter whether those values came from the host at creation or from the agent's own edit; either way this script has nothing better to put there.

if (wixConfigHasValues()) {          // existsSync && !includes('<YOUR-')
  deployed.wixConfig = 'already_set';
} else if (clientId && metaSiteId) {
  writeWixConfig(clientId, metaSiteId);
  deployed.wixConfig = 'written';
} else { ...placeholder note... }

Also removes the validation added in #980 — the uuid shape check and the anonymous-token mint against Wix. Neither belongs in an install step: the shape check catches nothing that a wrong-but-well-formed id would trip, and the mint made the step's success depend on Wix being reachable. deploy.cjs is synchronous again with no network calls, and no longer has a failure exit of its own.

STEP 1 keeps skills a host already installed (existsSync on each SKILL.md) instead of reinstalling over them, and the sentences promising verification are gone from base44.md and the placeholder file.

Net: -70 / +33.

Verified

Ran deploy.cjs against a fixture on all four paths:

on disk flags result
Cozy Knit's correct id its corrupted id already_set, file untouched
placeholders correct ids written
placeholders none placeholder note, exit 0
no file at all correct ids written (the shared copy lays the placeholder first)

Row 1 is the Cozy Knit regression: that corrupted id shipped a storefront where every call failed Wix OAuth failed: 400.

…placeholders

Base44 now writes src/rest/wix-config.js at app creation, from ids it already holds.
deploy.cjs ran after that and overwrote it from its flags, putting the transcription
this file exists to remove straight back in.

Now: a config carrying values is left alone; placeholders get the flags. That covers
the host-written case and the agent's own edit without distinguishing between them.

Also drops the uuid shape check and the anonymous-token mint added in #980. Neither
belongs in an install step — the shape check rejected nothing a wrong-but-well-formed
id would trip, and the mint made the step fail on Wix's availability. deploy.cjs is
back to being synchronous with no network calls, and STEP 1 keeps skills a host
already installed rather than reinstalling over them.
@ayal
ayal force-pushed the fix/host-written-wix-config-wins branch from 46ce51b to ab7ea35 Compare August 12, 2026 18:49
@ayal ayal changed the title fix(wix-vibe-headless): a config the host already wrote outranks the ids flags fix(wix-vibe-headless): write wix-config.js only when it still holds placeholders Aug 12, 2026
@ayal
ayal merged commit d9b7392 into main Aug 12, 2026
4 checks passed
@ayal
ayal deleted the fix/host-written-wix-config-wins branch August 12, 2026 20: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.

1 participant