Skip to content

Fix FFM-1689: enable cold-start session gate by default#322

Merged
ohld merged 1 commit into
productionfrom
fix/ffm-1689-cold-start-gate-default
Jun 22, 2026
Merged

Fix FFM-1689: enable cold-start session gate by default#322
ohld merged 1 commit into
productionfrom
fix/ffm-1689-cold-start-gate-default

Conversation

@ohld

@ohld ohld commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Enables COLD_START_NSESSIONS_GATE_ENABLED by default so low-sent dormant returners (nsessions >= 2) fall through to the growing-user blender instead of cold_start_adapt / cold_start_explore.
  • Keeps the explicit off-switch behavior covered as an emergency override.
  • Adds a default-config regression test proving dormant returners no longer reach cold-start engines.

Root cause

FFM-1161 implemented the nsessions <= 1 cold-start gate behind COLD_START_NSESSIONS_GATE_ENABLED, but the config default stayed False. If production does not explicitly set the env var, the gate is present but inert, matching the observed 7-day dormant-returner leak in FFM-1689.

Guardrail decision

I did not add a new positions 6-10 cold_start_adapt quality guardrail in this PR. The current report says adapt weakness is spread across 21 sources and direct/meme-link cohorts, while existing code already applies a text-light content guard. A source/content quality rule needs a follow-up experiment or Analyst isolation; this PR fixes the obvious routing/config bug first.

Verification

  • DATABASE_URL=postgresql+asyncpg://app:app@localhost:65432/app REDIS_URL=redis://localhost:36379/0 CORS_ORIGINS='["http://localhost"]' CORS_HEADERS='["*"]' TELEGRAM_BOT_TOKEN=test TELEGRAM_BOT_USERNAME=test_bot TELEGRAM_BOT_WEBHOOK_SECRET=test MEME_STORAGE_TELEGRAM_CHAT_ID=-1 UPLOADED_MEMES_REVIEW_CHAT_ID=-2 ADMIN_LOGS_CHAT_ID=-3 ENVIRONMENT=TESTING python3 -m pytest tests/recommendations/test_meme_queue.py tests/feed_turn/test_planner.py -q → 57 passed
  • ruff check --fix src/ tests/
  • ruff format src/ tests/

Fixes FFM-1689.

@ohld ohld marked this pull request as ready for review June 22, 2026 09:23
@ohld

ohld commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

STAFF ENGINEER REVIEW: APPROVED — Manual structural review clean. Codex review clean. Targeted verification passed: tests/recommendations/test_meme_queue.py + tests/feed_turn/test_planner.py, 57 passed. CI lint/test are green; proceeding with squash auto-merge.

@ohld ohld merged commit b620867 into production Jun 22, 2026
3 checks passed
@ohld

ohld commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

✅ Approved + merged.

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