chore(function): remove legacy share write endpoints by thdxr · Pull Request #56939 · anomalyco/opencode · GitHub
Skip to content

chore(function): remove legacy share write endpoints - #56939

Merged
thdxr merged 1 commit into
devfrom
remove-legacy-share
Oct 19, 2026
Merged

thdxr merged 1 commit into
devfrom
remove-legacy-share

Conversation

@thdxr

@thdxr thdxr commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Issue for this PR

Closes #

Type of change

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

What does this PR do?

Removes the write side of the original share API on api.opencode.ai (packages/function/src/api.ts, Api worker in infra/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_delete
  • SyncServer.share, SyncServer.publish, SyncServer.assertSecret, which only those routes used
  • The WEB_DOMAIN worker env var, which only share_create used
  • The /share prompt 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 through ShareNext on opncd.ai, and share.ts was deleted in v1.2.0. V2 never called these routes. Neither do current V1 releases, github/index.ts, or the published anomalyco/opencode/github@latest action. On those old clients, auto-share already swallows errors. Running /share or /unshare by hand will now fail, because the worker's catch-all returns Not Found with status 200 and the client can't parse that as JSON.

Kept on purpose:

  • GET /share_data, GET /share_poll, the SyncServer Durable Object and the Bucket R2 bucket. Old links at opencode.ai/s/<id> still render through them: Console /s/[id] proxies to docs.opencode.ai/s/[id] (packages/web), which reads from these routes.
  • POST /share_delete_admin and ADMIN_SECRET. This is the takedown path for those old shares while they stay public.
  • The Durable Object binding and migrations, unchanged. Removing the class would need a deleted_classes migration, and that deletes the stored share data.
  • /exchange_github_app_token, /exchange_github_app_token_with_pat and /get_github_app_installation. The GitHub Action (anomalyco/opencode/github@latest) installs the newest V1 release and runs opencode github run, which calls these. opencode github install on V1 calls the installation lookup.
  • /feishu, which is unrelated.

Deploy impact: this only redeploys the Api worker script, with three fewer routes and no WEB_DOMAIN var. 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 check passes.
  • bun test in packages/function passes.
  • bun build packages/function/src/api.ts bundles.
  • packages/function has no typecheck task. Running tsc there shows the same 13 errors before and after this change, all in untouched lines.
  • git grep on origin/dev and origin/v1 finds no remaining callers of the removed routes.

Screenshots / recordings

N/A

Checklist

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

— 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)

@opencode-agent opencode-agent Bot 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.

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.

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