Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,25 @@ OPENAI_API_KEY=sk-...

# Optional: override the model the smoke test uses (default: gpt-5.4-nano).
# OPENAI_MODEL=gpt-5.4-mini

# ─── LOCAL-ONLY PLAYTEST ESCAPE HATCHES ────────────────────────────────────
# These flags are read by `vite build` for `npx devvit playtest` ONLY. The
# deployed Reddit runtime does not set them — production behaviour is to
# read every value from Devvit settings via `settings.get(...)`.

# When the Devvit `settings` plugin RPC is unreachable inside the runtime
# (we saw this on r/SocialSeeding 2026-05-13), set this to a falsy 'mock' to
# bypass settings.get + fetch entirely in callOpenAI and return a fixed,
# deterministic fake compiled rule. Useful for testing the compose-rule
# UI flow when the platform is misbehaving. Unset / any other value =
# normal OpenAI call path.
# VIBE_MOD_AI_PROVIDER=mock

# When the Devvit `settings` plugin RPC is unreachable AND you want to
# run the *real* OpenAI call locally, set this to '1' and put your key in
# OPENAI_API_KEY above. callOpenAI will fall back to that env value ONLY
# if both `settings.get(subredditOpenaiApiKey)` and `settings.get(openaiApiKey)`
# failed to return a key. Do NOT ship a built bundle with this enabled to
# the public app directory — the env var is meant to be set on the local
# machine running playtest only.
# VIBE_MOD_LOCAL_OPENAI_FALLBACK=1
15 changes: 14 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint.config.js — flat config (ESLint 9). See https://eslint.org/docs/latest/use/configure/configuration-files
// eslint.config.js — flat config (ESLint 10). See https://eslint.org/docs/latest/use/configure/configuration-files
// Pairs with Prettier: this file owns *correctness* rules; Prettier owns formatting
// (eslint-config-prettier, applied last, disables any formatting rules that would conflict).

Expand Down Expand Up @@ -27,6 +27,19 @@ export default tseslint.config(
eqeqeq: ['error', 'smart'],
'no-var': 'error',
'prefer-const': 'error',
// ESLint 10 introduced `no-useless-assignment`, which fires on the
// common resilient-fallback pattern:
//
// let bundle: T | null = null; // <- flagged as useless
// try { bundle = await fetchIt(); }
// catch (err) { /* fall back */ }
// if (!bundle) return ...; // <- but the default IS used
//
// The default value IS read on the catch path; the rule's analysis
// doesn't see through the try/catch. Disable so we can keep the
// pattern (used heavily for reddit/devvit#258 workaround — every
// plugin RPC call is wrapped this way). See PR #30.
'no-useless-assignment': 'off',
},
},
{
Expand Down
Loading