feat(seer): Trigger explorer index if missing#114219
Conversation
…indexes When starting a new Explorer chat run, check the has_explorer_index and has_org_project_context flags returned by Seer. If either is false, dispatch explorer index tasks for the org's active projects with transactions so the index is populated without waiting for the next hourly scheduler run. Respects seer.explorer_index.enable and seer.explorer_index.killswitch.enable options, and uses dispatch_explorer_index_projects for consistent batching and load-spreading behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| if not options.get("seer.explorer_index.enable"): | ||
| return | ||
|
|
||
| if options.get("seer.explorer_index.killswitch.enable"): | ||
| logger.info("seer.explorer_index.killswitch.enable flag enabled, skipping") | ||
| return |
There was a problem hiding this comment.
I'll clean up options in a follow up
…ject context missing Extend _maybe_trigger_explorer_index_for_new_run to also dispatch index_org_project_knowledge and build_service_map when has_org_project_context is false and explorer.context_engine_indexing.enable is on. Also guard dispatch_explorer_index_projects behind a non-empty projects_batch check so the task is not enqueued unnecessarily when no active projects have transactions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c442e2a. Configure here.
|
|
||
| if options.get("seer.explorer_index.killswitch.enable"): | ||
| logger.info("seer.explorer_index.killswitch.enable flag enabled, skipping") | ||
| return |
There was a problem hiding this comment.
Explorer index killswitch also blocks context engine indexing
Low Severity
The early returns for seer.explorer_index.enable and seer.explorer_index.killswitch.enable gate both the explorer index dispatch and the context engine indexing (index_org_project_knowledge / build_service_map). These options are named specifically for the explorer index feature, but activating the killswitch or disabling the explorer index also silently prevents context engine indexing from being triggered via this code path. Since the context engine has its own independent option (explorer.context_engine_indexing.enable), the two features' controls are unexpectedly coupled.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c442e2a. Configure here.
|
|
||
| return result["run_id"] | ||
|
|
||
| def _maybe_trigger_explorer_index_for_new_run( |
There was a problem hiding this comment.
looks like we're keeping this completely separate from the explorer-index flagpole which I assume we're gonna use for the cron job only?
| logger.info("seer.explorer_index.killswitch.enable flag enabled, skipping") | ||
| return | ||
|
|
||
| if has_explorer_index is not None and not has_explorer_index: |
There was a problem hiding this comment.
| if has_explorer_index is not None and not has_explorer_index: | |
| if has_explorer_index is False: |
nit
There was a problem hiding this comment.
the linter won't let me do this lol
| has_org_project_context is not None | ||
| and not has_org_project_context |
There was a problem hiding this comment.
| has_org_project_context is not None | |
| and not has_org_project_context | |
| has_org_project_context is False |
When starting a new Explorer chat run, check the has_explorer_index and has_org_project_context flags returned by Seer. If either is false, dispatch explorer index tasks for the org's active projects with transactions so the index is populated without waiting for the next hourly scheduler run. Respects seer.explorer_index.enable and seer.explorer_index.killswitch.enable options, and uses dispatch_explorer_index_projects for consistent batching and load-spreading behaviour. Avg e2e latency on tasks are under a min with the cron job, so I'll release as is and monitor if we need to scale up the pods --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>


When starting a new Explorer chat run, check the has_explorer_index and has_org_project_context flags returned by Seer. If either is false, dispatch explorer index tasks for the org's active projects with transactions so the index is populated without waiting for the next hourly scheduler run.
Respects seer.explorer_index.enable and seer.explorer_index.killswitch.enable options, and uses dispatch_explorer_index_projects for consistent batching and load-spreading behaviour.
Avg e2e latency on tasks are under a min with the cron job, so I'll release as is and monitor if we need to scale up the pods