Skip to content

Add bot filtering modes to aggregation explorer#4806

Draft
SylvainChevalier wants to merge 1 commit into
mainfrom
claude/relaxed-dijkstra-Z1T0v
Draft

Add bot filtering modes to aggregation explorer#4806
SylvainChevalier wants to merge 1 commit into
mainfrom
claude/relaxed-dijkstra-Z1T0v

Conversation

@SylvainChevalier
Copy link
Copy Markdown
Contributor

Summary

This PR extends the aggregation explorer's bot filtering capabilities by replacing the binary include/exclude toggle with a three-mode selector that allows users to exclude bots, include bots, or view only bot forecasts.

Key Changes

  • Frontend UI Updates

    • Replaced the Switch component for bot filtering with a StyledSelect dropdown offering three options: "Exclude Bots", "Include Bots", and "Only Bots"
    • Updated the bot mode state management from a boolean includeBots to a BotMode type with values "exclude", "include", or "only"
    • Added new translation keys: excludeBots, onlyBots, and bots
  • API & Data Layer

    • Added onlyBots parameter throughout the aggregation data pipeline (frontend and backend)
    • Updated buildConfigId() to distinguish between include and only modes using "bots" and "obots" identifiers
    • Modified buildDisplayLabel() and buildChips() to handle the new "only bots" mode in display labels
    • Updated query state parsing to correctly deserialize the "obots" identifier
  • Backend Logic

    • Extended get_aggregations_at_time() and get_aggregation_history() to filter for only bot forecasts when only_bots=True
    • Restructured bot filtering logic to handle three distinct cases: only bots, include bots, or exclude bots
    • Updated the DataGetRequestSerializer to validate the new only_bots parameter
  • Type Updates

    • Added onlyBots field to SelectedAggregationConfig, AggregationQueryResult, and related types
    • Updated API parameter types to include the new onlyBots option

Implementation Details

The bot filtering now follows a priority order: if only_bots is true, only bot forecasts are included; otherwise, if include_bots is true, bots are included; otherwise, bots are excluded. This ensures mutually exclusive filtering modes while maintaining backward compatibility.

https://claude.ai/code/session_01Ncpz4kH3oett2Wonz1TMaQ

Adds a third state to the bot toggle in the aggregation explorer,
turning it into a select with "Exclude Bots" / "Include Bots" /
"Only Bots". The new option filters aggregation inputs to only
bot-authored forecasts.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e2b141b2-d87b-455d-8389-3cf6ec92e553

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/relaxed-dijkstra-Z1T0v

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4806-claude-relaxed-dijkstra-z1t0v-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:claude-relaxed-dijkstra-z1t0v-a809d00
🗄️ PostgreSQL NeonDB branch preview/pr-4806-claude-relaxed-dijkstra-z1t0v
Redis Fly Redis mtc-redis-pr-4806-claude-relaxed-dijkstra-z1t0v

Details

  • Commit: ca0b8c403c2a15d9b3b16886b27fae2781a4049a
  • Branch: claude/relaxed-dijkstra-Z1T0v
  • Fly App: metaculus-pr-4806-claude-relaxed-dijkstra-z1t0v

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants