Repository navigation
feat: Secrets Store CREDENTIALS_KEY, Create token menu, Remember + Environment, R2 chat archive - #28
Merged
implemented.stream (thanabartbb) merged 1 commit intoOct 15, 2026
Conversation
…+ /settings/environment, R2 chat stream archive - secrets_store_secrets binding CREDENTIALS_KEY (await env.CREDENTIALS_KEY.get(), cached), fallback to Worker secret then v1 - CreateTokenMenu (Cloudflare, GitHub fine-grained, OpenAI, Vercel, Hugging Face; URLs verified in provider docs) - Remember checkbox (default off = use once); migration 0012 user_env; /api/environment; /settings/environment (names + dates, delete) - direct deploy accepts one-off token, falls back to remembered CLOUDFLARE_API_TOKEN/ACCOUNT_ID - R2 binding CHAT_STREAMS: per-turn stream + thinking steps archive; D1 unchanged - fix: read endpoints no longer throttled by fixed 4/min limiter binding - verification: docs/verification/env-remember-rounds.md (3 rounds 17/17)
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 065e88e:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not deploy until the prerequisites below are done. The owner approves deploys separately.
What
CREDENTIALS_KEYwas created indefault_secrets_store(b56dddabe7d74172932cf26f4a2ab03f) on 2026-10-15 20:47 ICT. It is 32 random bytes in base64, piped fromopensslintowrangler secrets-store secret create, so it was never printed or written to disk. Per the owner's decision there is no backup. Thesecrets_store_secretsbinding is inwrangler.jsonc. Code reads it withawait env.CREDENTIALS_KEY.get(), cached per isolate, and falls back to a plain Worker secret, then to legacy v1. Existing v1 rows are re-sealed as v2 on first use after the deploy.src/components/tokens/create-token-menu.tsx) is next to every token input: Connections (Cloudflare, OpenAI), the direct-deploy one-off token, the AI agent panel, Sandbox Factory and Environment. It links to Cloudflare API tokens, GitHub fine-grained tokens, OpenAI API keys, Vercel tokens and Hugging Face tokens. Each URL was checked in the provider's docs (see the verification doc). The style is monochrome and it is our own component, with no 21st.dev code.0012_user_environment.sql.GET/POST /api/environmentandDELETE /api/environment/:name.PUTsaves only whenremember: true.{token, accountId, remember}. With no stored connection, the deploy (including the chat bot's deploy) falls back to the rememberedCLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_ID.sessionStorage.CHAT_STREAMSbinding points to bucketnvx-chat-streams. Each turn is written tochat/<uid>/<conversationId>/<messageId>.json. Deltas are merged, and reasoning and quota events are dropped. D1 history and the UI are unchanged. Archiving never breaks a turn.Fixes found while verifying
get()returned a non-native thenable. It is now wrapped in a Promise.gate()reads were throttled by the fixed 4/60 sNVX_CHAT_LIMITERbinding, so deploy-status polling every 3 s got 429 in production. Reads now use the per-isolate limiter. Writes are unchanged.Verified
docs/verification/env-remember-rounds.md.npm run buildpasses.Before deploy (owner)
Please enable R2 through the Cloudflare Dashboard [10042]for account2d92bd5b…at 20:47 and 20:54 ICT. After enabling R2 on that account, runwrangler r2 bucket create nvx-chat-streams. Otherwise the deploy fails on the binding.wrangler d1 migrations apply nvx-db --remote.