Skip to content

Background dev server#1362

Merged
matthewp merged 7 commits into
mainfrom
rfc-0057-dev-background
Jun 5, 2026
Merged

Background dev server#1362
matthewp merged 7 commits into
mainfrom
rfc-0057-dev-background

Conversation

@matthewp

@matthewp matthewp commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Background process management for astro dev, enabling AI coding agents to reliably start, monitor, query and stop the dev server.

Links

@matthewp matthewp changed the title Stage 3: astro dev --background Background dev server May 11, 2026
@matthewp matthewp mentioned this pull request May 11, 2026
@matthewp

Copy link
Copy Markdown
Contributor Author

I'm doing a call for consensus on this change.

Comment thread proposals/0057-dev-background.md Outdated
Comment thread proposals/0057-dev-background.md
Comment thread proposals/0057-dev-background.md Outdated

@ematipico ematipico left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things we should address imho:

  • telemetry
  • log rotation missing from PR
  • --background -> background (it's not a subcommand, given the PR)

Comment thread proposals/0057-dev-background.md
Comment thread proposals/0057-dev-background.md
Comment thread proposals/0057-dev-background.md
### Response Shape

```json
{"ok": true}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is false for when the endpoint isn't healthy?

Comment thread proposals/0057-dev-background.md Outdated
Comment thread proposals/0057-dev-background.md Outdated
# Adoption strategy

- **Fully opt-in.** Without `--background`, `astro dev` behaves exactly as it does today, unless an AI agent is detected, in which case background mode is enabled automatically.
- **Not a breaking change.** The new subcommands and flags are additions to the CLI. The `/_astro/status` endpoint is a new route in the dev server that does not conflict with user routes (it uses the `/_astro/` prefix already reserved by Astro). The lock file adds duplicate server detection to foreground mode, but this is a guard against a common mistake, not a behavior change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the sake of completeness: we should say that this endpoint doesn't exist in production. You never know!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a note on this.

Comment thread proposals/0057-dev-background.md Outdated
@matthewp

Copy link
Copy Markdown
Contributor Author

--background -> background (it's not a subcommand, given the PR)

Went back and forth on this and landed on what the stage 1 said, which was that --background is a flag on dev, but the other commands (stop, status, etc) are subcommands on dev. Updated the implementation PR to reflect.

@ascorbic ascorbic left a comment

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.

Approved!

@matthewp matthewp merged commit 3253f71 into main Jun 5, 2026
@matthewp matthewp deleted the rfc-0057-dev-background branch June 5, 2026 14:30
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.

4 participants