Run the docs site's chat endpoint on the Cloudflare adapter
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Read website/src/pages/api/chat.ts and the chatcopsCloudflareHandler adapter from @chatcops/server/cloudflare, then check how locals.runtime.ctx is provided by @astrojs/cloudflare. Replace the endpoint's custom stream handling with the adapter while preserving rate limiting and cf-connecting-ip handling, and configure the site's origin for CORS. Done when OPTIONS and POST return the same origin header and the website build and local chat work as described in the issue.
索引モデルが issue の本文から書いたものです。
説明
The docs site's chat endpoint (website/src/pages/api/chat.ts) builds its own SSE response around handleChat (the POST handler from line 79) instead of using chatcopsCloudflareHandler from @chatcops/server/cloudflare. The site runs on Cloudflare Workers, so it should run the same adapter users do: that way the site tests it, and fixes like #195 (stop the provider when the visitor leaves) don't have to be copied by hand. The OPTIONS handler (line 133) also answers Access-Control-Allow-Origin: * while POST sends no CORS header at all.
What to do
- Build the adapter once per isolate, the same lazy way the file builds the handler today (the API key only exists inside a request through
getSecret), and call it fromPOSTandOPTIONS. - Pass the Workers context so
waitUntilworks. With@astrojs/cloudflare14 it'slocals.cfContext(locals.runtime.ctxwas removed and throws). ogcops does the same insrc/pages/api/og.ts. - Set
corsto the site's own origin (https://chat.codercops.com) instead of*. - Keep the rate limiting and the
cf-connecting-iphandling the file has now.
Acceptance criteria
-
website/src/pages/api/chat.tsno longer has its own stream loop - The chat on the site still works locally with
pnpm --filter @chatcops/website dev(say how you tested it) -
OPTIONSandPOSTsend the sameAccess-Control-Allow-Origin -
pnpm --filter @chatcops/website buildsucceeds - No changeset needed (website only)
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 7
- 平均マージ
- 3時間 33分
- マージ済み PR(30日)
- 176
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/chatcops のほかの issue
-
Add startup checks that catch weak or leaked security settings対応中かも @varun-pahuja が 2 日前に担当しました。 オープンenhancement good first issue hacktoberfest server
codercops/chatcops#231 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Type-check the TypeScript samples in the docs対応中かも @An16og が 1 日前に担当しました。 オープンdocumentation hacktoberfest help wanted testing
難易度 4/5 3〜5日 初心者へのやさしさ 70/100
codercops/chatcops#201 · コメント 7 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
hacktoberfest
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Add built-in translations to the widget対応中かも @piyusshhjangid が今日担当しました。 オープンhelp wanted widget
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
codercops/chatcops#55 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
codercops/chatcops の issue をすべて見る
似ている issue
-
数据界面的横向滚动条缺失オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
zilliztech/attu#1037 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openclaw/openclaw#181212 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apify/apify-mcp-server#1684 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Automattic/data-liberation-agent#953 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
siteboon/claudecodeui#1642 ·
メンテナーはふだん 5 日以内に返信