Skip to content

feat(slm): per-role multi-node flag, node lists and per-node health (#19706) - #20597

Closed
mrveiss wants to merge 3 commits into
mainfrom
issue-19706-role-scale
Closed

mrveiss wants to merge 3 commits into
mainfrom
issue-19706-role-scale

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

The maintainer's ruling on #19706 puts the shared changes first: a per-role flag, a list of nodes in the API, and per-node health. Roles get the flag later, each one when its traffic can reach every node, so this PR adds no new scalable role and nothing changes for a user assigning roles today.

What Changed

  • Flag: a role's definition carries multi_node. MULTI_NODE_ROLES is derived from it, and only autobot_shared and slm-agent have it. A test fails if a role gets the flag without the test being updated.
  • Node list: GET /api/roles/owners returns a list of nodes per role, plus multi_node_roles. getRoleOwners in the SLM frontend still gives the views one owner per single-node role, so their warnings are unchanged. The frontend's second copy of the multi-node list is gone.
  • Per-node health: GET /api/roles/fleet-health adds roles_with_nodes_down. A scaled role with a service, on a node that is offline or in error or with its service inactive, turns a healthy fleet degraded, and the detail line names the nodes. The health views already show that line. A node the role isn't installed on yet, or one that is pending, enrolling, in maintenance or decommissioned, counts as neither up nor down.
  • No change for today's fleets: infrastructure roles sit on every node, so autobot_shared and slm-agent are left out of this check. Counting them would turn any offline node into a degraded fleet. The check starts to matter when the first service role gets the flag.
  • check_role_uniqueness no longer raises if a role somehow has rows on two nodes; it reports one of them.
  • get_role_owners moved to the new services/role_nodes.py, which lowers three file-size ceilings.

Verification

pytest tests/services/test_role_nodes.py tests/api/test_fleet_health.py tests/services/test_role_registry.py tests/services/test_role_manifest_shape_16025.py passes locally. The frontend test is left to CI. openapi.json and api.ts come from the repo's generators. Not tried on a host.

Traffic spreading and the role-by-role flags are still open, so this is Refs.

Model Used

Claude Opus 5.5

Refs #19706

@mrveiss mrveiss added the phase:M1.1 install.sh completes, fails loudly and is safe label Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bb1f46a and c2eb678.

Files ignored due to path filters: 2

  • autobot-slm-frontend/src/types/generated/api.ts is excluded by !**/generated/**
  • scripts/python_file_size_known_large.py is excluded by !scripts/python_file_size_known_large.py
Files selected for processing: 11

  • autobot-slm-backend/api/roles.py
  • autobot-slm-backend/services/role_nodes.py
  • autobot-slm-backend/services/role_registry.py
  • autobot-slm-backend/tests/api/test_fleet_health.py
  • autobot-slm-backend/tests/services/test_role_nodes.py
  • autobot-slm-frontend/openapi.json
  • autobot-slm-frontend/src/composables/useSlmApi.test.ts
  • autobot-slm-frontend/src/composables/useSlmApi.ts
  • autobot-slm-frontend/src/views/OrchestrationView.vue
  • docs/guides/slm-docker-ansible-deployment.md
  • scripts/frontend_file_size_known_large.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20597 (head 2ecc0c7): changes needed.

Read only; nothing was run. The flag has one home, and a single-node role yields the same owner map.

  • Blocker: verify-generated-types-slm, autofix-types and code-quality are red. api.ts is a hand edit and autobot-slm-frontend/openapi.json isn't changed, though FleetHealthResponse and /owners gained fields. Regenerate both.
  • Decision: the Thinking Path says nothing changes for users today, but services/role_nodes.py:60-61, :76-82 apply to every node carrying slm-agent, so one deliberately offline node turns /api/roles/fleet-health from healthy to degraded. Decide if that's intended or double-counts node health, and correct the text.
  • Medium, role_nodes.py:60-61: maintenance, decommissioned, degraded and pending nodes count as up, so nodes_up can name a decommissioned node.
  • Medium: get_roles_with_nodes_down, _service_multi_node_roles, get_role_owners, both endpoints and check_role_uniqueness have no real test; test_fleet_health.py mocks the module.
    Low: role_registry.py:671 .first() has no order, so the reported owner is arbitrary; nodes are named by a non-unique hostname.

@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20597 (head 9a6777f): approve.

Read only; nothing was run. Only multi-node roles that run a service and aren't infrastructure count, so today's fleets see no change; non-serving nodes count as neither up nor down; types are regenerated. This PR's many red checks at this moment look like cancelled runs, not failures, so a train is its real test. The earlier test gaps on the query and endpoints stand.

This was referenced Nov 2, 2026
@mrveiss

mrveiss commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at b27ba23

Verdict: APPROVE

Checked: MULTI_NODE_ROLES is now derived from the role definitions' own multi_node flag and a test pins which roles carry it; the frontend's second copy of the list is removed and getRoleOwners still returns one owner per single-node role, so the assignment warning is unchanged (the two OrchestrationView tests mock owners: {}, which never reaches the multi_node_roles read); get_role_owners has no other caller on main; roles_with_nodes_down defaults to an empty list so existing clients are unaffected; openapi.json and api.ts are regenerated; docs updated.

Severity File:line Issue Fix
low (non-blocking) autobot-slm-backend/services/role_nodes.py:60-69, 84-95 _scaled_service_roles() returns an empty list today (no service role carries the flag), so the get_roles_with_nodes_down query and join are never executed and have no test; only classify_role_nodes is covered. The first role flagged will be the first run of that SQL. Add a query-level test (or a note on #19706) to land with the first flagged service role.
low (non-blocking) autobot-slm-backend/services/role_nodes.py:62 Private import _INFRA_ROLES from role_registry inside the function. Expose a public accessor when a second consumer appears.
low (non-blocking) autobot-slm-backend/api/roles.py (GET /roles/owners) Response shape changed from role -> id to role -> [ids]. The only in-repo consumer is updated; any external caller of this admin API would break. Mention in the release note.

No blocking findings.

@mrveiss

mrveiss commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Landed on main via merge train #20897 (merge 19e62c8): commit b27ba23 taken by the train is in main and the three-dot diff of this PR's head against main is empty. Closing.

@mrveiss mrveiss closed this Nov 6, 2026
timothybrush pushed a commit to timothybrush/AutoBot-AI that referenced this pull request Nov 6, 2026
@mrveiss
mrveiss deleted the issue-19706-role-scale branch November 8, 2026 10:28
@mrveiss

mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Branch deleted after verification: every commit is in main and the branch shows 0 changed files against main. Restore it from this PR if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M1.1 install.sh completes, fails loudly and is safe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant