refactor(runtime): un-bundle non-channel bootstrap jobs from ServiceSet.channels (#5028) - #5079
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50720c61e6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthrough
ChangesBootstrap service selection
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).github/workflows/ci-lite.ymlTraceback (most recent call last): Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/core/runtime/services.rs (1)
236-278: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd enabled-path bootstrap diagnostics.
Only disabled branches log today. Log the selected plan, each enabled external dispatch, Composio reconcile start/completion, and function dispatch completion with a stable namespace such as
[runtime.bootstrap].As per coding guidelines, “New or changed flows must include verbose, grep-friendly diagnostics covering entry/exit, branches, external calls, retries/timeouts, state transitions, and errors.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/core/runtime/services.rs` around lines 236 - 278, Add verbose, grep-friendly diagnostics under the stable [runtime.bootstrap] namespace in start_bootstrap_jobs: log the selected bootstrap plan, each enabled service dispatch, Composio reconcile start and completion, and completion of the function’s dispatch sequence. Preserve the existing disabled-branch logs and add diagnostics at the corresponding enabled paths and function exit.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/core/runtime/builder.rs`:
- Around line 60-65: Move the integrations, memory_sync, and orchestration
bootstrap configuration from src/core/runtime/builder.rs lines 60-65 into a
dedicated src/openhuman/<domain>/ coordinator, preserving their behavior. Move
the corresponding flag-to-domain-job mapping from src/core/runtime/services.rs
lines 215-222 into that coordinator, leaving src/core focused only on transport
concerns.
---
Outside diff comments:
In `@src/core/runtime/services.rs`:
- Around line 236-278: Add verbose, grep-friendly diagnostics under the stable
[runtime.bootstrap] namespace in start_bootstrap_jobs: log the selected
bootstrap plan, each enabled service dispatch, Composio reconcile start and
completion, and completion of the function’s dispatch sequence. Preserve the
existing disabled-branch logs and add diagnostics at the corresponding enabled
paths and function exit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 83bd16b2-6f37-44d6-a8ea-17e7a893c062
📒 Files selected for processing (2)
src/core/runtime/builder.rssrc/core/runtime/services.rs
|
Addressed review + fixed the red CI lane. CI — Diagnostics (CodeRabbit, services.rs:236-278) — valid, matches the repo debug-logging rule. Added Move bootstrap policy out of Gates local: fmt ✓, clippy -D warnings ✓, gates-off check ✓, |
|
@coderabbitai review |
✅ Action performedReview finished.
|
bccc45b to
83a7dac
Compare
senamakel
left a comment
There was a problem hiding this comment.
Automated technical review: approved for the inspected head commit (83a7dac).
Summary of review
This PR un-bundles four non-channel bootstrap jobs (Composio integration sync, workspace memory-source periodic sync, orchestration message drain supervisor, and Composio source reconcile) from ServiceSet.channels by adding three new concern flags (integrations, memory_sync, orchestration) and a pure bootstrap_job_plan() mapping function. Desktop is byte-identical; headless/none stay job-free.
Correctness
- The
bootstrap_job_plan()flag-to-job mapping is correct: each of the four jobs previously gated byservices.channelsis now independently gated by the appropriate new flag. Thememory_queueandproactive_task_pollersmappings are unchanged. - All three presets preserve the exact prior job set:
desktop()(all on),headless_api()andnone()(all off). Verified by tests. - No other site constructs
ServiceSetvia struct literal, so the new fields cause no downstream compile break. - The
services.channelsfield now gates onlyspawn_channels_service()(the realtime channel listeners), which is the stated intent.
Test coverage (6 new tests in services.rs)
desktop_plan_enables_every_job— regression: desktop is byte-identicaljob_free_presets_enable_nothing— none/headless stay job-freeeach_concern_flag_enables_exactly_its_job— 3 sub-tests, single-flag independence from none()disabling_one_concern_disables_only_its_job— 3 sub-tests, single-flag isolation from desktop()channels_flag_gates_no_bootstrap_job— explicit #5028 regression: channels alone enables zero sync jobs; channels=false with new flags on loses nothing- Extended
boot_jobs_are_independent_from_runtime_service_flagsin builder.rs for all three presets
CI
- All checks green including PR CI Gate, Rust Feature-Gate Smoke (gates off), Rust Core Coverage, Rust Quality (fmt, clippy), Feature Forwarding Gate.
- CI Lite diff adds
core::runtime::to the gates-off cargo test filter andcore/runtime/services.rsto the gated-test allowlist — both correct and minimal.
Observations (non-blocking)
- Pre-existing concern:
spawn_channels_service()->start_channels()still callscomposio::start_periodic_sync(),task_sources::start_periodic_poll(), andstart_board_poller()directly (startup.rs:184-192), bypassing the new flags. This is documented, idempotent (no-op without active Composio connections), and out of scope for this un-bundle PR. A channels-on host that wants integrations off still sees the redundant idle ticks. Worth a follow-up to threadServiceSetintostart_channels()so the flags control all paths uniformly. The unresolved Codex review thread on this issue is acknowledged.
Summary
ServiceSet.channelsswitch by giving them their own runtime flags —integrations,memory_sync,orchestration.Problem
start_bootstrap_jobsgated four jobs behindif services.channels— none of which is channel-specific:composio::start_periodic_sync— Composio integration connection syncmemory_sync::workspace::start_workspace_periodic_sync— workspace memory sources (repos, folders, RSS, web pages)orchestration::start_message_drain_supervisor— relay-mailbox drain supervisormemory_sources::reconcile::ensure_composio_sources— one-shot source reconcileThey shipped alongside channel startup as a historical grab-bag (the
elselog even blurs it as "channel/integration pollers"). An embedder composing channels OFF + memory/integrations ON lost all four with only a debug log; conversely a channels-ON build dragged in orchestration and sync loops it never asked for.Solution
ServiceSetflags (integrations,memory_sync,orchestration), not one — the four jobs span three distinct concerns, so a single coarse flag would reproduce the bug one level down. The Composio pair (start_periodic_sync+ensure_composio_sources) legitimately sharesintegrations: both no-op without active Composio connections. Not folded into existing flags —memory_queuegates ingestion workers, not outbound source polling.channels, which istrueonly indesktop(); sodesktop()sets all three new flagstrue,headless_api()andnone()set themfalse. Desktop stays byte-identical; headless/none stay job-free.bootstrap_job_plan(&ServiceSet) -> BootstrapJobPlan— a pure,PartialEqmapping struct is the single source of truth for flag→job;start_bootstrap_jobscomputes it then spawns each job behind its plan bool, replacing theif services.channelsblock with three concern blocks each carrying its own precise disabled-by-ServiceSet log. After this,services.channelsgates no bootstrap job — its only remaining meaning isspawn_channels_service(the realtime listeners), which is the point of the issue.ServiceSet { … }literals; every other site uses a preset ± field mutation, so no other code changes to compile. Fields staypub; no#[non_exhaustive](matchesDomainSetconvention).Submission Checklist
none/headless_api), single-flag independence in both directions, and the ServiceSet::channels bundles non-channel bootstrap jobs (composio sync, memory sync, orchestration drain) #5028 regression (channelsalone gates zero bootstrap jobs;channels=false+ the new flags on loses nothing). Theboot_jobs_are_independent_from_runtime_service_flagspreset test is extended for the three new fields. (Jobs spawn detached global-state loops, so the pure plan — notstart_bootstrap_jobs— is what's exercised.)bootstrap_job_plan, all exercised by the new tests. Enforced on merge by CI.## Related.Closes #5028in## Related.Impact
desktop()runs the identical four jobs.cargo check+ gates-off check pass,fmt/clippy -D warningsclean (0 new),cargo test --lib core::runtime17/17.Related
ServiceSet/DomainSetseam these flags extendservices.rshunk wrapsspawn_channels_service; it never touchesstart_bootstrap_jobsorbuilder.rs. Disjoint hunks, not stacked; trivial rebase for whichever merges second.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
refactor/5028-serviceset-unbundle50720c61eValidation Run
pnpm typecheck/format:check— no TypeScript or frontend files changedcargo fmt --checkclean;cargo checkclean;cargo clippy -- -D warningsclean (0 new)GGML_NATIVE=OFF cargo check --no-default-features --features tokenjuice-treesittercargo test --lib core::runtime(17)Behavior Changes
channelsservice flag;channelsno longer gates non-channel jobs.Parity Contract
desktop()runs the exact same four jobs as before;headless_api()/none()stay job-free.bootstrap_job_planmaps each preset to its prior job set (pinned by tests).Duplicate / Superseded PR Handling
Summary by CodeRabbit