chore: migrate wrangler.toml to wrangler.jsonc - #79
Conversation
Converts config from TOML to JSONC format: - All bindings preserved: Hyperdrive, R2, KV, AI, Durable Objects, migrations, observability, tail_consumers, cron triggers - Bumps compatibility_date to 2026-03-02 - Adds CHITTYGOV_URL to vars - Updates references in CLAUDE.md, AGENTS.md, copilot-instructions.md - Fixes mcp-query.sh to use hardcoded KV ID instead of grepping toml - Verified via wrangler deploy --dry-run: all bindings intact Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
📝 WalkthroughWalkthroughThe PR migrates the Worker configuration from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
To use Codex here, create a Codex account and connect to github. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
chittycommand-ui | 9dfccc3 | Apr 06 2026, 10:24 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dfccc3ea7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/mcp-query.sh (1)
8-9: Avoid locking this script to a single KV namespace ID.Line 8 hard-codes one account/environment namespace, so a KV rotation or environment switch can silently break token lookup. Prefer sourcing
KV_IDfrom env and fail fast if unset.♻️ Proposed refactor
-KV_ID="64eef343b99b46ac909dbbcc1c4b2dee" # COMMAND_KV namespace from wrangler.jsonc +KV_ID="${COMMAND_KV_ID:-}" +if [ -z "$KV_ID" ]; then + echo "ERROR: COMMAND_KV_ID is required (COMMAND_KV namespace id)" >&2 + exit 1 +fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/mcp-query.sh` around lines 8 - 9, The script currently hard-codes KV_ID and then fetches TOKEN using that value; change KV_ID to read from an environment variable (e.g., KV_ID="${KV_ID:-}") and if it's empty print a clear error and exit non‑zero (fail fast), then use that KV_ID in the TOKEN command (TOKEN=$(npx wrangler kv key get "mcp:service_token" --namespace-id="$KV_ID" --remote 2>/dev/null)); ensure any existing hard-coded literal is removed or only used as an explicit fallback with a comment, and update the inline comment to note the env-sourced behavior so KV rotations/environments won’t silently break.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/mcp-query.sh`:
- Around line 8-9: The script currently hard-codes KV_ID and then fetches TOKEN
using that value; change KV_ID to read from an environment variable (e.g.,
KV_ID="${KV_ID:-}") and if it's empty print a clear error and exit non‑zero
(fail fast), then use that KV_ID in the TOKEN command (TOKEN=$(npx wrangler kv
key get "mcp:service_token" --namespace-id="$KV_ID" --remote 2>/dev/null));
ensure any existing hard-coded literal is removed or only used as an explicit
fallback with a comment, and update the inline comment to note the env-sourced
behavior so KV rotations/environments won’t silently break.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 46817895-af1d-4459-95a8-22be95dc2dcc
📒 Files selected for processing (6)
.github/copilot-instructions.mdAGENTS.mdCLAUDE.mdscripts/mcp-query.shwrangler.jsoncwrangler.toml
💤 Files with no reviewable changes (1)
- wrangler.toml
- Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB by using chunked base64 encoding (affects both single and batch uploads) - Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79), add SVC_STORAGE service binding to wrangler.jsonc instead - Fix batch upload: check ChittyStorage response for errors, create cc_documents DB records so batch uploads appear in UI - Add fallback warning log when single upload falls through to legacy R2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB by using chunked base64 encoding (affects both single and batch uploads) - Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79), add SVC_STORAGE service binding to wrangler.jsonc instead - Fix batch upload: check ChittyStorage response for errors, create cc_documents DB records so batch uploads appear in UI - Add fallback warning log when single upload falls through to legacy R2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…aps (#90) - Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB by using chunked base64 encoding (affects both single and batch uploads) - Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79), add SVC_STORAGE service binding to wrangler.jsonc instead - Fix batch upload: check ChittyStorage response for errors, create cc_documents DB records so batch uploads appear in UI - Add fallback warning log when single upload falls through to legacy R2 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…aps (#93) * fix: document upload crash, duplicate wrangler config, batch upload gaps - Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB by using chunked base64 encoding (affects both single and batch uploads) - Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79), add SVC_STORAGE service binding to wrangler.jsonc instead - Fix batch upload: check ChittyStorage response for errors, create cc_documents DB records so batch uploads appear in UI - Add fallback warning log when single upload falls through to legacy R2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: apply CodeRabbit auto-fixes Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai> * fix: apply CodeRabbit auto-fixes (#97) Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai> * fix: apply review fixes to batch upload error handling, processing_status, and add r2_key unique migration Co-authored-by: chitcommit <208086304+chitcommit@users.noreply.github.com> * Update src/routes/documents.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: apply CodeRabbit auto-fixes Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Converts wrangler config from TOML to JSONC. All bindings preserved (verified via dry-run). Bumps compatibility_date to 2026-03-02. Adds CHITTYGOV_URL. Updates doc references.
Summary by CodeRabbit