Skip to content

fix(sites): keep framework start commands out of the console - #3156

Open
HarshMN2345 wants to merge 3 commits into
mainfrom
fix/sites-hide-start-command
Open

fix(sites): keep framework start commands out of the console#3156
HarshMN2345 wants to merge 3 commits into
mainfrom
fix/sites-hide-start-command

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

What

Removes the start command field from the new-site flows, moves it under a collapsed Advanced section in site settings, and stops the console from ever rendering an Appwrite-internal command.

The bug

src/lib/stores/sites.ts declared:

export type FrameworkAdapterWithStartCommand = Models.FrameworkAdapter & {
    startCommand?: string;
};

Every create-site flow cast the adapter to that type, then used adapter.startCommand both to prefill the input and as its placeholder. The API never returns that field — FrameworkAdapter does not declare a startCommand rule — so the reads always resolved to undefined, and the cast was the only thing keeping it typechecking. Had the field ever been sent, the console would have shown an internal runtime command (bash helpers/next-js/server.sh) to every user creating a site, inviting them to copy a value that changes without notice.

Changes

Create-site flows — field removed entirely; startCommand is no longer sent on create, so the server applies its own default:

  • create-site/configuration.svelte (shared by the repository and manual flows)
  • create-site/manual/+page.svelte
  • create-site/repositories/repository-[repository]/+page.svelte
  • create-site/deploy/+page.svelte — also drops the ?start= URL parameter and shouldShowStartCommand

Site settings (site-[site]/settings/updateBuildSettings.svelte) — the input stays for SSR sites but:

  • moves out of the Settings fieldset into a collapsed Accordion title="Advanced"
  • takes a generic Enter start command placeholder
  • loses its Reset button, which had no default to reset to
  • no longer gets overwritten from adapter data when the framework changes

CleanupFrameworkAdapterWithStartCommand is gone, so nothing casts its way around the SDK type any more.

Only the site's own stored startCommand is still read anywhere, and only to pass it through on unrelated updates.

Verification

npm run check0 errors, 87 warnings (all pre-existing, none in changed files). Prettier clean.

The create-site flows read startCommand off a framework adapter and
offered it as a prefilled value and a placeholder. The API never returns
that field - FrameworkAdapter does not declare it - so the reads always
resolved to undefined, and the cast that made them typecheck was the only
thing hiding it. Had the field ever been returned, the console would have
put an internal runtime command in front of every user creating a site.

Drop the field from the create flows entirely and let the server pick its
own default. In site settings the input stays, but it moves under a
collapsed Advanced section, loses the Reset-to-default button that had
nothing to reset to, and takes a generic placeholder.
@appwrite

appwrite Bot commented Aug 12, 2026

Copy link
Copy Markdown

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Our Discord community has grown to 24K developers, and counting

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR removes unsupported framework start-command defaults from site creation and moves the stored command into an advanced settings section.

  • Removes start-command inputs and payload fields from all site-creation paths.
  • Removes the unsupported framework-adapter type extension.
  • Clears or conditionally submits stored start commands when framework and adapter settings change.

Confidence Score: 4/5

The PR is not yet safe to merge because adapter transitions after a framework change can restore and submit the previous framework's incompatible start command.

The attempted fix clears the command on the initial framework change, but the later adapter-change branch restores site.startCommand solely by matching the original adapter key, leaving the previously reported stale-command failure reachable.

Files Needing Attention: src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte Moves the SSR start command under Advanced and attempts to clear stale values, but a framework change followed by adapter transitions can restore the original command.
src/routes/(console)/project-[region]-[project]/sites/create-site/configuration.svelte Removes the unsupported start-command field and adapter cast from the shared creation configuration.
src/routes/(console)/project-[region]-[project]/sites/create-site/deploy/+page.svelte Removes start-command URL handling, rendering, defaults, and create payload submission.
src/routes/(console)/project-[region]-[project]/sites/create-site/manual/+page.svelte Stops reading and submitting adapter start commands during manual site creation.
src/routes/(console)/project-[region]-[project]/sites/create-site/repositories/repository-[repository]/+page.svelte Stops reading and submitting adapter start commands during repository-backed creation.
src/lib/stores/sites.ts Removes the unsupported FrameworkAdapterWithStartCommand type extension.

Fix All in Greploop

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
### Issue 1
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte:114
**Old start command gets restored**

When an SSR site is changed to another framework and its adapter is then changed away from and back to SSR, this branch restores `site.startCommand` solely because the adapter key matches the original adapter. The subsequent update submits the old framework's command for the newly selected framework, causing deployments to use an incompatible entrypoint.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (3): Last reviewed commit: "Clear the start command when the framewo..." | Re-trigger Greptile

A start command names an entrypoint belonging to one framework. Carrying it
across a switch submits it against a runtime that has no such entrypoint,
and a switch to static leaves a command the form no longer shows.

Reset it alongside the other framework-derived fields, and send it only for
the ssr adapter, matching the fallbackFile line beside it.
fallback = isOriginalAdapter
? (site?.fallbackFile ?? data.fallbackFile)
: data.fallbackFile;
startCommand = isOriginalAdapter ? (site?.startCommand ?? '') : '';

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.

P1 Old start command gets restored

When an SSR site is changed to another framework and its adapter is then changed away from and back to SSR, this branch restores site.startCommand solely because the adapter key matches the original adapter. The subsequent update submits the old framework's command for the newly selected framework, causing deployments to use an incompatible entrypoint.

Knowledge Base Used: Functions and Sites

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte
Line: 114

Comment:
**Old start command gets restored**

When an SSR site is changed to another framework and its adapter is then changed away from and back to SSR, this branch restores `site.startCommand` solely because the adapter key matches the original adapter. The subsequent update submits the old framework's command for the newly selected framework, causing deployments to use an incompatible entrypoint.

**Knowledge Base Used:** [Functions and Sites](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/console/-/docs/project-functions-sites.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

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