Skip to content

feat(discover): let users turn off the content filter - #380

Merged
linroid merged 2 commits into
fix/discover-installer-filterfrom
feat/discover-content-filter
Oct 4, 2026
Merged

linroid merged 2 commits into
fix/discover-installer-filterfrom
feat/discover-content-filter

Conversation

@linroid

@linroid linroid commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Stacked on #377 (installer filter fix). Merge that first; this PR then retargets to main.

What

  • [ai] contentFilter (on by default) adds a Content filter switch to Settings → Discover, plus a settings-search entry. It travels with each search (DiscoverQuery.contentFilter) and is left out of AiSettings.engineSettings, so changing it never rebuilds the engine.
  • With the filter off, results keep the agent's own confidence. Private and local addresses, sites outside a "Limit to websites" search, and discarded links stay hidden either way.
  • The engine counts the results it hid (DiscoverResult.filtered), and each message saves the count in the history (DiscoverTurn.filtered). A message shows "N hidden by the content filter · Discover settings" under its results. When the filter hid everything, the No downloads found card says so and has a Discover settings button.
  • CLI: follows contentFilter, adds --no-filter, and notes the hidden count on stderr.

Why

When the filter hid every result, the chat showed the agent's "Found 3…" summary above "No downloads found", with no hint why and no way to see the results anyway.

Notes for reviewers

  • Turning the filter off only skips Ketch's own check. The agent is still instructed to prefer official sources and avoid unsafe ones.
  • New strings are translated into all nine languages. The docs are updated in docs/ai-discovery.md (new "The content filter" section), cli/README.md and AGENTS.md.
  • New snapshot scenarios: discover-filtered and discover-all-filtered.

Tests

  • AgentOutputParserTest: filtered results are counted; with the filter off they are kept but private addresses are still dropped.
  • AiSettingsTest, AiSettingsControllerTest: the setting defaults on, round-trips through TOML and keeps the provider.
  • AiDiscoverControllerTest, DiscoverThreadItemsTest, DiscoverHistoryCodecTest: the setting is sent with each search, and the count is stored, saved, and shown as the line or the card.
  • AiDiscoverArgsTest: --no-filter.

@linroid
linroid added this pull request to stack #381 October 4, 2026 09:29
@linroid
linroid force-pushed the feat/discover-content-filter branch from 45e4625 to 1a42bf0 Compare October 4, 2026 09:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45e46259ea

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T09:30:44.614295Z 45e4625 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Adds [ai] contentFilter (on by default), a Content filter switch in Settings
> Discover and --no-filter in the CLI. The engine counts the results the
filter hid; a message shows "N hidden by the content filter" with a link to
Discover settings, or says so in its No downloads found card.
…icks one

The parser removed duplicates before checking them, so a clean copy behind
one the filter blocks vanished. Each copy is now checked, the first that
passes is kept, and a link counts as hidden only when no copy passes.
@linroid
linroid force-pushed the feat/discover-content-filter branch from 5124ab7 to 46cb7fe Compare October 4, 2026 09:43
@linroid
linroid merged commit 2d19f53 into main Oct 4, 2026
1 check failed
@linroid
linroid deleted the feat/discover-content-filter branch October 4, 2026 09:43
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.

1 participant