Repository navigation
chore(function): remove legacy share write endpoints - #56939
Conversation
There was a problem hiding this comment.
The change looks good. Nothing left in the repository calls the removed routes, the removed SyncServer methods or WEB_DOMAIN. The parts you kept still work together: share_delete_admin uses clear(), which uses getSessionID(), and the old /s/[id] pages in packages/web still read from share_data and share_poll. I couldn't run the Cloudflare worker here, so I checked it by reading the code: bun test in packages/function passes, src/api.ts bundles, and tsc only shows the same 13 errors you reported, all in lines this change doesn't touch.
Public API: this removes POST /share_create, POST /share_sync and POST /share_delete from api.opencode.ai. It is not backwards compatible for V1 clients v1.0.143 and older: running /share or /unshare there will now fail, and auto-share fails silently. No current V1 or V2 client, SDK, plugin API, config key or CLI flag is affected.

Issue for this PR
Closes #
Type of change
What does this PR do?
Removes the write side of the original share API on
api.opencode.ai(packages/function/src/api.ts,Apiworker ininfra/app.ts). People still find these routes and file issues about them, but no supported client uses them.Removed:
POST /share_create,POST /share_sync,POST /share_deleteSyncServer.share,SyncServer.publish,SyncServer.assertSecret, which only those routes usedWEB_DOMAINworker env var, which onlyshare_createused/shareprompt in the bug report template. Sharing is discontinued on both V1 and V2, so the link it asked for would be dead.Who called them: only V1 clients v1.0.143 and older (
packages/opencode/src/share/share.ts). From v1.0.144 (Dec 2025), sharing went throughShareNextonopncd.ai, andshare.tswas deleted in v1.2.0. V2 never called these routes. Neither do current V1 releases,github/index.ts, or the publishedanomalyco/opencode/github@latestaction. On those old clients, auto-share already swallows errors. Running/shareor/unshareby hand will now fail, because the worker's catch-all returnsNot Foundwith status 200 and the client can't parse that as JSON.Kept on purpose:
GET /share_data,GET /share_poll, theSyncServerDurable Object and theBucketR2 bucket. Old links atopencode.ai/s/<id>still render through them: Console/s/[id]proxies todocs.opencode.ai/s/[id](packages/web), which reads from these routes.POST /share_delete_adminandADMIN_SECRET. This is the takedown path for those old shares while they stay public.deleted_classesmigration, and that deletes the stored share data./exchange_github_app_token,/exchange_github_app_token_with_patand/get_github_app_installation. The GitHub Action (anomalyco/opencode/github@latest) installs the newest V1 release and runsopencode github run, which calls these.opencode github installon V1 calls the installation lookup./feishu, which is unrelated.Deploy impact: this only redeploys the
Apiworker script, with three fewer routes and noWEB_DOMAINvar. No sst resources are created or destroyed, and no bindings, buckets, Durable Object classes, secrets or domains change.How did you verify your code works?
bun run checkpasses.bun testinpackages/functionpasses.bun build packages/function/src/api.tsbundles.packages/functionhas no typecheck task. Runningtscthere shows the same 13 errors before and after this change, all in untouched lines.git greponorigin/devandorigin/v1finds no remaining callers of the removed routes.Screenshots / recordings
N/A
Checklist
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
Added by the opencode bot (AI-generated).
Public API: removes POST /share_create, /share_sync, /share_delete from api.opencode.ai (breaks /share and /unshare only on V1 ≤ v1.0.143)