Skip to content

dedup(analytics): one home for the code tool probe (#18557) - #20463

Merged
mrveiss merged 3 commits into
mainfrom
issue-18557-analytics-status
Nov 1, 2026
Merged

mrveiss merged 3 commits into
mainfrom
issue-18557-analytics-status

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thinking Path

#18557 lists api/analytics* get_*_status x5 as a clone row. Read closely, those routes mostly aren't clones. What they really duplicate is one check: three sites ask the same two tool paths whether they exist. That check gets one home, and the routes stay separate.

Route Decision
/status, /code/status, dashboard overview helper Share the new probe
Dashboard and bug prediction task status Already share known_task_status_or_404
Budget, agent budget, learning, monitoring, pre-commit Stay separate: each returns its own payload from its own source

What Changed

  • analytics_controller.py: new AnalyticsController.code_tools_available(), checked off the event loop as before.
  • analytics.py, analytics_code.py: the three sites call it. analytics.py drops from 1277 to 1269 lines, and its ceiling turns down with it.
  • Guard: shared_helper_cores_18557_slice5_test.py fails if either file checks a tool path directly or builds the result dict itself.
  • Floors: two reach floors re-pinned, as the pre-push gate asked.

Verification

$ pytest api/analytics_controller_code_tools_test.py utils/thread_safety_test.py api/redis_key_count_19232_test.py -q
====================== 25 passed, 107 warnings in 10.71s =======================
$ pytest repo_tests/shared_helper_cores_18557_slice5_test.py -q
============================== 2 passed in 0.95s ===============================

With analytics.py put back to main's version, the guard fails:

E   AssertionError: autobot-backend/api/analytics.py
========================= 1 failed, 1 passed in 1.06s ==========================

That run predates the guard's dict check, which has its own test in the file.

A code-reviewer pass read all three responses and found the same shape and values as before. Its report on the guard and on this table's reasoning led to the follow-up commit.

Not checked: the three routes on a running backend. The new test calls the probe directly.

The floor repin was killed by its own timeout under load, and it had written these two floors before that. The pre-push gate then passed with them.

Risks

  • Mock controllers: a test that replaces the controller for /code/status now needs an async code_tools_available. No test does that today.
  • Guard scope: it reads these two files only, so a copy in another analytics module wouldn't be caught.
  • analytics_controller.py still checks each path on its own in perform_code_analysis. Each check there gates a different step, at a different moment, so the helper doesn't fit.

Model Used

Claude Opus 5.5

Issue Link

Refs #18557

🤖 Generated with Claude Code

Three sites asked the same two paths whether they exist. They now call
AnalyticsController.code_tools_available, and a guard stops the copies
returning. The other status routes stay separate: their payloads differ.
@coderabbitai

coderabbitai Bot commented Nov 1, 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 23 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 45f10d1 and 85cd76f.

Files ignored due to path filters: 1
  • scripts/python_file_size_known_large.py is excluded by !scripts/python_file_size_known_large.py
Files selected for processing: 7
  • autobot-backend/api/analytics.py
  • autobot-backend/api/analytics_code.py
  • autobot-backend/api/analytics_controller.py
  • autobot-backend/api/analytics_controller_code_tools_test.py
  • repo_tests/root_resolver_single_source_18101_test.py
  • repo_tests/shared_helper_cores_18557_slice5_test.py
  • repo_tests/slm_agent_single_definition_19040_test.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 1, 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.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20463 (head 85cd76f): approve. Read directly: all three probes now share code_tools_available with the same keys and off-loop checks, plus a guard and floors.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Auto-sync: merging main into issue-18557-analytics-status conflicts

The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base 45f10d1773. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.

repo_tests/root_resolver_single_source_18101_test.py

side commit subject issue refs
main 517e836e7 fix(train): reach floors return to mid-window on the merged tree (#20435) #20435
this branch 85cd76faa chore(guards): re-pin the reach floors the pre-push gate reported stale (#18557) #18557

repo_tests/slm_agent_single_definition_19040_test.py

side commit subject issue refs
main 517e836e7 fix(train): reach floors return to mid-window on the merged tree (#20435) #20435
this branch 85cd76faa chore(guards): re-pin the reach floors the pre-push gate reported stale (#18557) #18557

@github-actions github-actions Bot added the sync-conflict Set by the branch sync (#19548) label Nov 1, 2026
@mrveiss mrveiss added the phase:M4.8 Shrink the symbol-fork baseline label Nov 1, 2026
@mrveiss
mrveiss merged commit a75b87b into main Nov 1, 2026
32 of 71 checks passed
mrveiss added a commit that referenced this pull request Nov 1, 2026
@mrveiss
mrveiss deleted the issue-18557-analytics-status branch November 1, 2026 13:28
@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Landed via the merge train (PR #20500), main 64943e3.

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

Labels

phase:M4.8 Shrink the symbol-fork baseline sync-conflict Set by the branch sync (#19548)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant