Skip to content

feat(serve): shutdown endpoint#20292

Open
axel7083 wants to merge 1 commit intoanomalyco:devfrom
axel7083:feature/shutdown-endpoint
Open

feat(serve): shutdown endpoint#20292
axel7083 wants to merge 1 commit intoanomalyco:devfrom
axel7083:feature/shutdown-endpoint

Conversation

@axel7083
Copy link
Copy Markdown

@axel7083 axel7083 commented Mar 31, 2026

Issue for this PR

Closes #20277

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Provide a /shutdown endpoint to stop the server and opencode exit nicely.

How did you verify your code works?

  1. Build & start opencode container
$: cd packages/opencode
$: bun run build
$: podman build -t localhost/opencode:latest -f Containerfile .
$: podman run -it --rm -p 4096:4096 localhost/opencode:latest serve --hostname=0.0.0.0 --port 4096
  1. In another terminal curl the /shutdown endpoint
$: curl --location --request POST 'http://0.0.0.0:4096/shutdown'

Assert the server shutdown gracefully.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
@axel7083 axel7083 force-pushed the feature/shutdown-endpoint branch from 86344fc to 2c956a3 Compare April 1, 2026 13:42
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.

[FEATURE]: Implement /shutdown REST endpoint

1 participant