Skip to content

fix: give the pre-upgrade index check AI_QUEUE_WORKER_ENABLED when the AI worker is on [ENG-2181] - #76

Merged
twk3 merged 1 commit into
mainfrom
fix/eng-2181-ai-index-env-in-index-check
Nov 13, 2026
Merged

twk3 merged 1 commit into
mainfrom
fix/eng-2181-ai-index-env-in-index-check

Conversation

@twk3

@twk3 twk3 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Owner: @twk3

Linear: ENG-2181

The app declares the MongoDB indexes on aiSessions, aiSessionMessages and aiSlackCallbacks (including the TTLs that expire AI sessions) only when AI_QUEUE_WORKER_ENABLED=true. #74 set the variable on the scheduler when aiQueueWorker.enabled is on, inline in its template. #72's pre-upgrade index Job runs the same migrate CLI and never got it. So with the AI worker on:

  • the gate estimate leaves out the AI indexes, so a release that adds one to a large aiSessionMessages would pass the check unestimated;
  • build mode doesn't build them, and the scheduler builds them at startup instead.

Changes

  • currents.indexDeclarationEnv in _common.tpl: renders AI_QUEUE_WORKER_ENABLED=true when aiQueueWorker.enabled is on, and nothing otherwise.
  • The scheduler and the pre-upgrade Job both include it. The scheduler's rendered output is unchanged, apart from the YAML comment that moved into the helper's doc comment.

Checked

  • helm lint with ci/lint-values.yaml passes.
  • helm template against main, with aiQueueWorker.enabled false and true: identical when false. When true, the only differences are the variable on the Job and the moved comment on the scheduler.
  • On Docker Desktop Kubernetes, with the AI worker on and the aiSessions expiresAt_1 index dropped:
    • main's hook had no AI_QUEUE_WORKER_ENABLED and logged "No index builds pending.";
    • this branch's hook had the variable and estimated a pending build;
    • migrate index-plan in the scheduler pod listed aiSessions expiresAt_1 as pending with the variable, and left the AI collections out without it.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…e AI worker is on [ENG-2181]

The app declares the AI collections' MongoDB indexes only with
AI_QUEUE_WORKER_ENABLED set. The chart set it on the scheduler but not
on the pre-upgrade index Job, so with aiQueueWorker.enabled the check's
estimate and its build mode left those indexes out. The flag now comes
from one helper, currents.indexDeclarationEnv, used by both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@baz-reviewer

baz-reviewer Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Ensure the pre-upgrade index Job receives AI_QUEUE_WORKER_ENABLED whenever the AI worker is enabled, matching the scheduler’s index declarations. Centralize this environment-variable rendering in currents.indexDeclarationEnv so AI index estimates and builds include the relevant collections and TTLs.

Latest Contributors(2)
UserCommitDate
dj@currents.devfix: give the pre-upgr...November 12, 2026
agoldis@users.noreply....feat: add the ai-queue...November 12, 2026

Merger   ✅ Ready to Merge

MERGE: the diff adds the AI worker environment to both the scheduler and pre-upgrade index Job, matching the stated fix. CI ran and there are no unresolved discussions.



Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

@twk3
twk3 marked this pull request as ready for review November 13, 2026 00:01
@twk3
twk3 merged commit 10f9a1d into main Nov 13, 2026
3 checks passed
@twk3
twk3 deleted the fix/eng-2181-ai-index-env-in-index-check branch November 13, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant