Skip to content

feat: add the ai-queue-worker service [ENG-2181] - #40

Open
agoldis wants to merge 1 commit into
mainfrom
agoldis/eng-2181-ai-queue-worker
Open

agoldis wants to merge 1 commit into
mainfrom
agoldis/eng-2181-ai-queue-worker

Conversation

@agoldis

@agoldis agoldis commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Owner: @agoldis

Linear: ENG-2181

Adds the ai-queue-worker service. On-prem webhooks no longer runs AI tasks after the Currents release that contains currents-dev/currents#4874, so without this service AI explanations and chat stop.

This must ship with, not before, the Currents release that contains currents-dev/currents#4874. The image ai-queue-worker does not exist before then, so docker compose pull fails for the new service on any earlier tag. Merge it into the release that sets DC_CURRENTS_IMAGE_TAG to that tag.

Changes

  • templates/compose.currents.yml: service ai-queue-worker, image ${DC_CURRENTS_IMAGE_REPOSITORY}ai-queue-worker:${DC_CURRENTS_IMAGE_TAG}, built like webhooks (env_file: .env, CURRENTS_ENV: onprem, no ports, no command override).
  • Redis and MongoDB depends_on, and the RustFS FILE_STORAGE_FORCE_PATH_STYLE, are copied from webhooks in the three data-service templates.
  • Compose files regenerated with scripts/sync-templates.sh.
  • .env.example and docs/configuration.md: the LLM_* and AI_QUEUE_CONCURRENCY settings. No new required variable; they are optional.
  • docs/container-images.md: ECR policy and both image-mirroring lists. on-prem/README.md: services list.
  • on-prem/CHANGELOG.md: Unreleased entries with the upgrade notes below.
  • webhooks and the director are unchanged. No compose file sets AI_QUEUE_WORKER_ENABLED.
  • No VERSION or image tag change; the release PR does that.

Upgrade notes for on-prem customers

  • Add the currents/on-prem/ai-queue-worker repository to your ECR policy and mirror the image with the others.
  • Regenerate your compose file if you use custom templates.
  • Set LLM_PROVIDER_URL and LLM_API_KEY in .env if you use AI.
  • If .env sets AI_QUEUE_WORKER_ENABLED=true, also set SLACK_AI_CALLBACK_WORKER_ENABLED=true if you use Slack AI, and keep the first variable for the director's AI indexes.

Checked

  • docker compose -f docker-compose.{full,database,cache}.yml config --quiet with a minimal .env, as the validate workflow does: all three pass.
  • scripts/sync-templates.sh: the committed files match the templates.
  • Not run: the Podman validation, and the smoke test (it starts only scheduler and api, so it does not start the new service).

Checklist

  • PR title is Changelog-friendly: (fix|feat|chore): title [CSR-xxx]
  • User-friendly and meaningful description of the changes
  • Documentation was updated

🤖 Generated with Claude Code

https://claude.ai/code/session_011baD3izoabUn31Y3WeQHMp

On-prem webhooks no longer runs AI tasks. The new ai-queue-worker service
consumes the ai-bmq queue; without it, AI explanations and chat stop.

- Service in compose.currents.yml, same image repository and tag as the
  other services, same .env. Redis and MongoDB dependencies and the RustFS
  path-style setting are copied from webhooks. Compose files regenerated.
- .env.example and the configuration reference list the LLM_* settings.
- Docs: services list, ECR policy and image mirroring lists, changelog
  upgrade notes.

The image exists only in the Currents release that contains
currents-dev/currents#4874. Release this with that image tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3izoabUn31Y3WeQHMp
@baz-reviewer

baz-reviewer Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Add the ai-queue-worker service to run on-prem AI explanations and chat from the ai-bmq queue after webhooks stops processing AI tasks. Update Compose deployments, image access, configuration, and upgrade documentation so operators can deploy and configure the worker alongside existing services.

Topics

TopicDetails
Operations Documentation Document AI worker configuration and upgrades, register its image for ECR access and mirroring, and list it among on-prem services.
Modified files (5)
  • docs/configuration.md
  • docs/container-images.md
  • on-prem/.env.example
  • on-prem/CHANGELOG.md
  • on-prem/README.md
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comfeat: add the ai-queue...November 10, 2026
dj@currents.devprep-release: on-prem ...October 23, 2026
AI Worker Deployment Add and wire the ai-queue-worker container into on-prem Compose templates and generated database, cache, and RustFS variants, including required dependencies and environment settings.
Modified files (7)
  • on-prem/docker-compose.cache.yml
  • on-prem/docker-compose.database.yml
  • on-prem/docker-compose.full.yml
  • on-prem/templates/compose.currents.yml
  • on-prem/templates/compose.mongodb.yml
  • on-prem/templates/compose.redis.yml
  • on-prem/templates/compose.rustfs.yml
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comfeat: add the ai-queue...November 10, 2026
dj@currents.devprep-release: on-prem ...October 23, 2026

Merger   🟡 Pending

The reviewer raised three open concerns about making the worker opt-in via the ai Compose profile and documenting how customers enable it, but the diff does not address them. The author has not yet responded or pushed a fix.



Skills  Activate Skill Maintainer to keep your skills up to date

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

baz-app[bot]
baz-app Bot previously approved these changes Nov 10, 2026

@twk3 twk3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this locally on images built from main 6f87424c7 (includes currents-dev/currents#4874), full compose file, with USE_MOCK_AI=true. The worker starts and webhooks no longer takes AI tasks. testSidebarAiAnalysis.spec.ts passed with its GraphQL stub removed: both requests in aiRequests completed, and only ai-queue-worker logged them.

One change requested: put the service behind a Compose profile so it is off by default for now. AI is already off per org until features.aiAnalysis is set, and the worker needs LLM_* settings to do anything, so most installs would run an idle container and have to pull and mirror an image they don't use. With a profile, docker compose pull and up skip it unless COMPOSE_PROFILES includes ai. traefik already does this with tls. Comments inline.

EMAIL_TRANSPORTER: smtp

# Runs the AI tasks from the ai-bmq queue. Reads the LLM_* settings from .env.
ai-queue-worker:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a profile here so the service is off by default?

  ai-queue-worker:
    profiles:
      - ai

Then regenerate with scripts/sync-templates.sh. I checked that COMPOSE_PROFILES=ai in .env turns it on (COMPOSE_PROFILES=tls,ai with TLS), and that the depends_on and FILE_STORAGE_FORCE_PATH_STYLE overrides in the mongodb, redis and rustfs templates still merge onto it.

Comment thread on-prem/.env.example
# =============================================================================
# AI explanations and chat (Optional)
# =============================================================================
# The ai-queue-worker service runs the AI tasks (test explanations, chat) and

@twk3 twk3 Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the profile, this section should say how to turn the service on: a commented # COMPOSE_PROFILES=ai line above LLM_PROVIDER_URL for customers to uncomment, noting it combines with tls as COMPOSE_PROFILES=tls,ai. Same for the AI section in docs/configuration.md.

Comment thread on-prem/CHANGELOG.md
- Image `ai-queue-worker`. Pull or mirror it with the other images (see [Container Image Access](../docs/container-images.md)), and add the `currents/on-prem/ai-queue-worker` repository to your ECR policy.

### Upgrade Notes
- `webhooks` no longer runs AI tasks. Without the `ai-queue-worker` service, AI explanations and chat stop. The service reads the same `.env` as the others; `LLM_PROVIDER_URL`, `LLM_API_KEY` and the other `LLM_*` settings apply to it (see AI Explanations and Chat in the [Configuration Reference](../docs/configuration.md)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the profile off by default, this note needs to tell AI users to add ai to COMPOSE_PROFILES when they upgrade. If an org has aiAnalysis on and the worker isn't running, the API still enqueues on ai-bmq and the dashboard shows the request as pending with no end: I found no timeout that marks it failed. The ### Added image note can also say the image is only needed with the ai profile.

@baz-app
baz-app Bot dismissed their stale review November 10, 2026 18:51

Baz withdrew its approval because this pull request is no longer ready to merge.

This branch has not been deployed

No deployments
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.

2 participants