feat(channels): put the feature behind a flag (env var + UI switch) - #6651
feat(channels): put the feature behind a flag (env var + UI switch)#6651mmabrouk wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true📝 SummarySummary by CodeRabbit
WalkthroughThe PR gates channel broker activity and channel routes with ChangesChannels Feature Gating
Priority: ⬇️ Low — Defer the Channels feature-gating change because it is an opt-in deployment and per-user control with routes and the inbox worker disabled by default. Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to Channels remains disabled unless the deployment flag enables it, but the environment examples can mislead operators into setting a frontend flag that the runtime configuration overrides. Clarifying the documented source of truth is advisable before deployment. Sequence Diagram(s)sequenceDiagram
participant Environment
participant ChannelsConfig
participant BackendRouters
participant RuntimeConfig
participant SettingsAccess
participant SettingsNavigation
Environment->>ChannelsConfig: Read AGENTA_CHANNELS_ENABLED
ChannelsConfig->>BackendRouters: Provide channels enabled state
BackendRouters->>BackendRouters: Start broker and mount routes when enabled
RuntimeConfig->>SettingsAccess: Provide NEXT_PUBLIC_AGENTA_CHANNELS_ENABLED
SettingsAccess->>SettingsAccess: Combine deployment flag with user opt-in
SettingsAccess->>SettingsNavigation: Provide canShowChannels
SettingsNavigation->>SettingsNavigation: Show or hide Channels tab
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
api/oss/src/utils/env.py (1)
814-817: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the feature-gate comments. Keep one short line that explains only the non-obvious reason for the deployment gate.
api/oss/src/utils/env.py#L814-L817: replace the four-line comment with one short line.api/entrypoints/routers.py#L1665-L1667: replace the three-line comment with one short line.As per coding guidelines, comments must be minimal, explain only the non-obvious why, and contain at most one short line.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Advanced
Run ID: 248a0ac8-be25-45d9-bfbd-bfb1b5f74db5
📒 Files selected for processing (14)
api/entrypoints/routers.pyapi/oss/src/utils/env.pyhosting/docker-compose/ee/env.ee.dev.examplehosting/docker-compose/oss/env.oss.dev.exampleweb/entrypoint.shweb/oss/src/components/pages/settings/Preferences/Preferences.tsxweb/oss/src/components/pages/settings/hooks/useSettingsAccess.tsweb/oss/src/lib/helpers/dynamicEnv.tsweb/packages/agenta-settings/src/access.tsxweb/packages/agenta-settings/src/navigation.tsweb/packages/agenta-shared/src/api/env.tsweb/packages/agenta-shared/src/api/index.tsweb/packages/agenta-shared/src/state/featureFlags.tsweb/packages/agenta-shared/src/state/index.ts
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
…I switch
The channels feature ships dark. Two independent gates:
- AGENTA_CHANNELS_ENABLED (backend, default false): the ingress and the
configuration routes do not mount and the inbox broker does not start,
so a deployment carries the code without exposing the feature.
NEXT_PUBLIC_AGENTA_CHANNELS_ENABLED is the same flag for the web.
- A per-user switch in Settings > Preferences ("Channels", BETA): even
with the deployment flag on, a person opts in before the Channels
settings tab appears. The tab's visibility is gated on both.
Both env examples document the flag; the web entrypoint maps the
deployment variable into the public one, as it does for the tools flag.
Claude-Session: https://claude.ai/code/session_01HXt8WBUK9MrWKNTYbUKpaT
…nput (CodeRabbit) entrypoint.sh writes NEXT_PUBLIC_AGENTA_CHANNELS_ENABLED from AGENTA_CHANNELS_ENABLED, so the examples list only the deployment variable and say the public one is derived. Claude-Session: https://claude.ai/code/session_01HXt8WBUK9MrWKNTYbUKpaT
8c1bdeb to
c5c8813
Compare
a6e8a40 to
765cc6b
Compare
… per-user switch The per-user Preferences toggle gated the tab a second time and defaulted off, so the tab was invisible even with the feature enabled. The tab now shows whenever AGENTA_CHANNELS_ENABLED is on, like the other edition-gated tabs. The dead per-user switch and its atom are removed.
Context
Stacked on #6650. The channels feature must ship dark, so a release can carry it without exposing it, and so we can turn it on only where we test.
Changes
Two independent gates:
AGENTA_CHANNELS_ENABLED(default false) decides whether the ingress and the configuration routes mount and whether the inbox broker starts. Off, the whole surface 404s and the worker stays idle.NEXT_PUBLIC_AGENTA_CHANNELS_ENABLEDis the same flag for the web; the web entrypoint maps the deployment variable into the public one, exactly as it does for the tools flag.Both env examples document the flag. The flag is on for the QA stack.
Tests
channels.enabled=true. With the flag off, the routes are absent.https://claude.ai/code/session_01HXt8WBUK9MrWKNTYbUKpaT